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

*From*: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>*Date*: Sun, 07 Oct 2007 15:25:17 -0400

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)

joe

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 theJoseph M. Newcomer [MVP]

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

email: newcomer@xxxxxxxxxxxx

Web: http://www.flounder.com

MVP Tips: http://www.flounder.com/mvp_tips.htm

.

**Follow-Ups**:**Re: This calculation is just wrong / computer can't count!***From:*Alexander Grigoriev

**References**:**This calculation is just wrong / computer can't count!***From:*GT

**Re: This calculation is just wrong / computer can't count!***From:*AliR \(VC++ MVP\)

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

**Re: This calculation is just wrong / computer can't count!***From:*Luke alcatel

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

**Re: This calculation is just wrong / computer can't count!***From:*Joseph M . Newcomer

**Re: This calculation is just wrong / computer can't count!***From:*David Ching

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

- Prev by Date:
**Re: This calculation is just wrong / computer can't count!** - Next by Date:
**Re: This calculation is just wrong / computer can't count!** - Previous by thread:
**Re: This calculation is just wrong / computer can't count!** - Next by thread:
**Re: This calculation is just wrong / computer can't count!** - Index(es):