Your number is close to the minimum number expressible as a float
. To be exact, it is in the "denormalized" range, so we are limited in precision.
1.37e-43f
and 1.38e-43f
are both expressed as 0x00000062
in memory. According to the definition of IEEE 754 floats, that means that
- the sign is 0 (1 bit), thus +
- the exponent is 0 (8 bit), thus denormalized and
- the mantissa is 0x62 (23 bit), meaning 0.000 0000 0000 0000 0110 0010
All this means we have a number of
(binary) 0.000 0000 0000 0000 0110 0010 * 2 ^ -126
= 0.1100010 * 2 ^ -142
= 1100010 * 2 ^ -149
= (decimal) 98 * 2 ** -149 = 1.3732724950383207e-43
= (binary) 1.100010 * 2 ^ -143 = (hexadecimal) 0x1.88p-143, as used by the C format specifier %a.
As you see, only the lowest bits in the mantissa are used.
The lowest bit has a value of 2 ** -149 = 1.401298464324817e-45. This is as well the step between exactly representable values.
So,
- the float represented by
0x00000062
has, as seen, a value of f2 := 1.3732724950383207e-43 = 0x1.88p-143,
- the float represented by
0x00000063
has a value of f3 := 1.3872854796815689e-43 = 0x1.8cp-143,
- the float represented by
0x00000061
has a value of f1 := 1.3592595103950726e-43 = 0x1.84p-143.
There are no possible values in-between, as we are denormalized and close to the precision limit.
From the values we examine,
- 1.36E-43 is closest to f1,
- 1.37E-43 is closest to f2,
- 1.38E-43 is closest to f2 and
- 1.39E-43 is closest to f3.
The same holds for the range 1.47E-43 to 1.49E-43 and 1.57E-43 to 1.59E-43.