Subject: | |
From: | |
Reply To: | |
Date: | Wed, 4 Jan 1995 14:48:28 -0700 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Item Subject: Don't just worry about Pentiums!
I ran the calculation on a 937/SX running MPE/iX 4.0 using the CALC
command. Got "1050108, $1005FC, %4002774" as a result, which looks a
lot like your IBM. I then tried it in Qedit, with the "=" command, and
received ".0" as the correct result. Does it have something to do with
the way decimals are rounded?. CALC (4195835/3145727) only gives a
result of 1, rather than Qedit's "1.33382044914". Try 5 - ((5/2)*2).
CALC gives you "1", Qedit ".0"
Russ Johnson
DCBU McMinnville
______________________________ Reply Separator _________________________________
Subject: Don't just worry about Pentiums!
Author: Non-HP-owner-hp3000-l ([log in to unmask]) at HP-Unix
Date: 1/4/95 8:49 AM
As noted by one of our CompSci professors at UTC, Pentiums aren't the only
things to be worried about:
> I sent out a calculation which causes the Pentium to produce answer
> 256 when the "correct" answer is 0. If you run the same computation
> on our IBM ES9000 (in either FORTRAN or C) you get the following
> results:
>
> INTEGER REAL LONGINT DOUBLE
> 4195835 4195835.000000 4195835 4195835.000000
> 3145727 3145727.000000 3145727 3145727.000000
> 1050108 1.000000 1050108 0.000000
>
> Bottom row should produce value 0
Of course the integer calculations would be wrong, but it misses the
boat on single-precision reals! (The ES9000 is this machine, utcvm.utc.edu)
The calculation is: 4195835 - ( (4195835/3145727) * 3145727 )
Our HP960 does it correctly with both float and double, as did one
of our Suns.
Apparently it's a function of IEEE floating point versus the IBM's
goofy floating point format (wonder what a classic 3000 would say?)
[\] Jeff Kell, [log in to unmask]
|
|
|