Re: This calculation is just wrong / computer can't count!

The FPU keeps 80-bit values. It also uses an implicit "hidden" bit, since the high-order
bit of a floating point value is always redundant, since it is always 1. It is implied
but never present, which gives an additional bit of mantissa. There's a lot of detail
described in the FPU manual, which you can actually download from the Intel Web site (I
did this a few years ago, so I don't remember the link, but I recall it took very little
searching to actually find the download once I got to the Intel site)
On Sun, 7 Oct 2007 05:44:51 -0500, "BobF" <rNfOrSePeAzMe@xxxxxxxxxxx> wrote:

David - You might try "guard bits". That's a method that's been used in the
past. It's the old trick where you divide 10 by 3, see .333333333, then
multiply by 3. Sometimes you would see .999999 and sometimes you would see
10. Those that displayed 10 were said to employ guard bits.

The methods may have changed over the years, but it should get you on the

"David Ching" <dc@xxxxxxxxxxxxxxxxxxxxxx> wrote in message
I want to ask: can anyone recommend a library that produces results like a
calculator (I believe it is called fixed precision decimal)? I understand
that the floating point types in C++ are not meant for this, but what
search terms do I google to find a library that offers this functionality?

I had thought BCD (binary coded decimal) would be a good start, but there
isn't anything on sourceforge, for example that has this....


Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
MVP Tips:

Relevant Pages