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



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
trail.


"David Ching" <dc@xxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:4RYNi.918$R95.474@xxxxxxxxxxxxxxxxxxxxxxx
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....

Thanks,
David



.



Relevant Pages