4 ms·
Actually, epsilon is guaranteed to be much larger than the minimum representable float: double(pi) is 1.57... * 2^1, so double(pi) - pi is going to be on the or
by nhaehnle 12y ago
Actually, epsilon is guaranteed to be much larger than the minimum representable float: double(pi) is 1.57... * 2^1, so double(pi) - pi is going to be on the order of 2^-m, where m is the size of the mantissa. The only way that double(pi) - pi could be much smaller is if pi magically had a lot of 0s in its binary representation (it doesn't).
This caught me off-guard at first as well, but it's really quite logical.
- colanderman 12y agoThe only way that double(pi) - pi could be much smaller is if pi magically had a lot of 0s in its binary representation (it doesn't). Yes, this is what I was getting at. Obviously the statement is true for pi and the majority of reals; I just don't understand why it should be a rule as the article implies.