In my CS homework for Computer Architecture, I ran across this interesting problem. My professor wants us to find a single-precision and a double-precision number such that when you add 1 to either of them, the number is not changed at all. Why does this make sense, and how can I go about finding these numbers??
Thanks!
Keep in mind that floating point numbers have a limited precision (the number of significant digits they can keep track of). For single precision floats that’s about 7 digits, for double precision about 16 digits.
Also keep in mind that the range of floating numbers can exceed 3 x 10^38 – so clearly not all of the digits will be significant.