3 ms·
My example has nothing to do with decimal rounding. It's an example of a product (6172293634027511 * 7059478094414279) whose result is extremely close to the fe
by stromgo 12y ago
My example has nothing to do with decimal rounding. It's an example of a product (6172293634027511 * 7059478094414279) whose result is extremely close to the fence between two representable numbers (4837593847918366.5 * 2^53). If the 106-bit product happened to be 2 units smaller, then the rounded result would change.
- dragontamer 12y agoAs stated before, Floating Point numbers "don't round correctly" according to IEEE Floating Point arithmetic. There are very simple rules on how to round. This makes calculation of errors a bit complicated. http://en.wikipedia.org/wiki/IEEE_floating_point#Rounding_rules http://en.wikipedia.org/wiki/IEEE_floating_point#Rounding_ru... At best, Intel at one point provided 80-bit rounding (ie: 68-bit mantissa). That is, if you use the x87 floating-point coprocessor. But these technically do not match IEEE specifications for rounding.
- fdej 12y agoEr, what? Floating point numbers do "round correctly" (in binary) -- that's pretty much the whole point of the IEEE standard. In particular, to compute a product of two 53-bit floating-point numbers with correct rounding (as the standard mandates), it is certainly not sufficient in general to compute just a 54-bit approximation and round that.
- deleted 12y ago[deleted]