Your C implementation likely uses the IEEE-754 binary32 format for float
. In this format, every finite number is, in effect, a sign (+ or −) applied to a 24-bit integer M multiplied by some power of two.
Since 21 ≤ 3.25678932 < 22, the power of two used is 22−24 = 2−22. (The −24 scales the 24-bit integer to between ½ and 1, and the 2 scales that to between 2 and 4.)
Then, to choose the integer M, we choose the integer that is closest to 3.25678932/2−22. 3.25678932/2−22 is about 13,659,964.472, so we use 13,659,964.
Thus, the result of converting 3.25678932 to float
is 13,659,964•2−22, which is exactly 3.25678920745849609375.
When you print this rounded to 10 digits after the decimal point, the result is “3.2567892075”.