floating point - Smallest integer after only integers can be expressed IEEE 754 -
what smallest integer after integers can represented ieee 754 (single/double)?
my guess occurs when exponent 254 (11111110b single). that, no matter 1 puts in mantissa number integer. want confirm , equivalence in powers of 2.
presuming “after” refers numbers greater magnitude , not later in time, 223 32-bit binary floating-point , 252 64-bit binary floating-point. (these float
, double
in common programming language implementations type names.)
this because significands of 32-bit , 64-bit formats have 24 , 53 bits, respectively. so, in 32-bit format, if high bit scaled 222 exponent, low bit 2–1 (from 22 –1, inclusive, 24 positions). since significand contains bit scaled non-integer value, complete represented value non-integer. if high bit scaled 223 or greater, low bit has value @ least 20.
so, if integer less 223, @ 223–1, means high significand bit scaled 222, low bit 2–1. indeed, 223–½ representable float
.
the same reasoning applies double
.
Comments
Post a Comment