In principle, this is a rounding error.
In binary representation, floating point values ββare separated by exponent and mantissa. This means that inside, your number is represented as:
(1.634471118450164794921875) * 2^31
However, the first part of this number is limited to setting within 23 bits ( Wikipedia on 32-bit floats ), so we should round to the nearest 2^-23 :
(1.634471118450164794921875) % (0.00000011920928955078125) = 1.6344711780548095703125
So your number is actually:
(1.6344711780548095703125) * 2^31
If we 3510000128 this, we get 3510000128 , not 3510000000 .
In short, this is the same rounding error that you get when specifying 0.1 : none of them can be accurately expressed given the limitations of the representation.
source share