M
Martin Brown
Jerry W. Lewis said:I got it by experimentation, and then saw that Arvi had also determined
the same limit. I find it interesting that MS makes no attempt to
explain such an unusual limit.
The mantissa of a long floating point number has 54 bits significance
and 2^27 is the value with exactly half that number of bits.
If you choose a particularly stupid and naive way of computing x MOD y
then things can go wrong when the denominator *and* quotient exceed the
limit 2^27. However, they only tested the quotient value x/y < 2^27.
The dodgy way to do it in floating point is frac(x/y)*y
But no one in their right mind would ever implement mod this way. And
anyway most high level languages have a correct mod library function.
An additional unusual limit that applies, is that MOD returns #NUM!
regardless of the quotient if the first argument exceeds
2.68873542664192E14 = 2^20+2^19+2^18+2^17+2^15+2^12+2^8+2^6
which is within the range of exact DP representation of whole numbers
by more than an order of magnitude.
???? I don't understand. 2.688E14 is a shade under 2^48
And I don't see any such odd limit in XL2k. It appears to work more or
less OK here for larger values up to around 2^54 of the numerator x and
denominator y. (provided that x/y < 2^27)
I'd believe it does go wrong for some specific large values though. It's
always hard to predict the behaviour of flawed algorithms
experimentally.
Since they have documented it I guess we can expect a fix in about 2014.Jerry
(based on the latency time for the recent fixes to the statistics bugs)
Regards,