As Markus already explained, you are using a integral only library.
Check if you do need indeed floating point numbers, for a small 8 bit chip using integers (including longs) is much efficient.
Also
voltage = 4096/1023*result;
is not actually performing the computation in floating point arithmetic, instead it computes
voltage = 4*result;
4096/1023 is 4 (int type), and not 4.0039100684...
Daniel