"Sean O'Dell" <sean / celsoft.com> writes:

> On Wednesday 12 May 2004 12:50, Guillaume Marcais wrote:
>> On Wed, 2004-05-12 at 15:35, Hal Fulton wrote:
>> > Mohammad Khan wrote:
>> > > I guess, you guys are missing the point,
>> > >
>> > > in real life you can't have exact answer of 1/3 + 2.3 + 1.3
>> > > but you can have exact answer of 625.91 + 900.00 + 22.00
>> >
>> > Only if you build a computer that works in decimal. In binary,
>> > 625.91 is as inexact as 1/3 is in decimal.
>>
>> Well, my HP48 calculator's processor is able to do math in binary or
>> decimal. The real numbers are stored in memory in decimal and the
>> operations by default made in decimal. It doesn't make my calculations
>> any more precise, but it made (some of) the rounding errors less
>> suprising.
>
> Sort of makes me wonder if someone somewhere doesn't make a replacement FPU 
> that does all of its calculations as real decimal values, or at least 
> automatically corrects rounding errors.

Well, the IBM mainframes from the 1960's had decimal arithmetic hardware
built in.  They could do fixed point (integer), floating point, and
decimal arithmetic via CPU instructions.

In fact, they even had several different internal formats for the
numbers used in decimal arithmetic.

COBOL and PL/I compilers from back then could use this CPU capability
directly for calculations.

Do more modern chunks of Big Iron still have built-in packed and zoned
decimal arithmetic hardware?

In any case, the machines that most of us are likely to use these days
have to do this kind of math in software only.



> 	Sean O'Dell


-- 
 Lloyd Zusman
 ljz / asfast.com
 God bless you.