4 ms·
Not especially. Just floating point without fixed size significand and exponent. I do like the idea of having an "exact representation" bit carried along though
by lfowles 10y ago
Not especially. Just floating point without fixed size significand and exponent. I do like the idea of having an "exact representation" bit carried along though..
Edit: Link has been changed to a more in depth ACM interview!
I suppose this is a floating point format that makes the intervals more explicit by changing size to account for significant digits.
- Someone 10y agoI don't see big benefits for the 'exact' bit. There's only a fixed (in theory, countably infinite and infinitely dense) set of numbers that can be represented exactly. If you want to go for such a set of exactly-representable numbers, wouldn't the rationals be the better choice? That allows you, for example, to do dollar accounting in exact arithmetic. Also, to enable round-tripping with string representations, your printf/scanf pair has to discriminate between exact and inexact versions of, for example, 3/4. If you don't, every string you read in (e.g. from XML (including reading modern spreadsheet data), json, or from user input, will have to have the 'exact' bit cleared. I guess so many numbers will be inexact that it turns out to have close to zero information content (in other words: adding it to your numbers is a waste of space)
- Maken 10y agoIt avoids error whenever possible. For example, if you are working with pure fractions the result will be exactly representable and you'll end with 1/3 + 1/3 + 1/3 = 1 instead of some approximation.
- Someone 10y agoThat would be nice, but 1/3 isn't exactly representable in this representation. Or are you suggesting that, when computing 1/3, this number format picks the best representation for a given number of bits, keeping the 'exact' bit, for 1/3, and then magically decides that, say, 85/256 and 'exact' must be 1/3, and not 85/256, or whatever other expression that could be computed exactly gets close to it?