What is the exact range of (adjacent) integers that can be expressed as double (respectively float?). The reason I am asking is that I am interested, questions such as this one , when there will be a loss of accuracy.
it
- What is the smallest positive integer
msuch that m+1it cannot be exactly expressed as a double (float, respectively)? - What is the largest negative integer
-nsuch that -n-1it cannot be exactly expressed as double (resp float)? (May be the same as above).
This means that every integer is between -nand mhas an exact floating point representation. I am basically looking for a range [-n, m]for both floats and doublings.
Limit the scope of the standard IEEE 754 32-bit and 64-bit floating point representations. I know that a float has 24 precision bits, and a double has 53 bits (both with a hidden leading bit), but because of the intricacies of the floating point representation, I am looking for an authoritative answer for this. Please do not wave your hands!
(An ideal answer will prove that all integers from 0to mare expressible and that is m+1not.)
source
share