Re: CDC Floating point = tests?
- From: Gordon Sande <g.sande@xxxxxxxxxxxxxxxx>
- Date: Tue, 30 Jan 2007 17:58:31 GMT
On 2007-01-30 13:39:47 -0400, "stocksami@xxxxxxxxxxxxx" <stocksami@xxxxxxxxxxxxx> said:
On the old CDC machines running EKS you could use a regular if test to
see if two floating point values were equal, and it worked! I've
ported lots of code from EKS to other platforms and I've had to change
those lines of codes many many times. I'm currently doing another
upgrade to one of those programs. It would read in floating point
values with formatted read statements and compare to other floating
point values. They weren't integer values either. The code relied
heavily on this and it worked fine. How did this work? How did the
CDC compiler handle this?
By making sure that the compiler and runtime libraries use exactly the same
algorithms, probably by using the same code, for the formatted to native
conversions.
At one time on the IBM 7090 there were two Fortran compilers so the
same literal could produce three different bit patterns. The runtime
was shared by the two compilers but each compiler had its own conversion
routine and no two matched.
Eventually folks worked out two things. One was to cure this folly and
the other was how much precision was needed on output so that the input
would be exactly the same. Turned out it was a bit more that the folk wisdom
because of some special cases. Conversion can be subtle which is why good
formatted i/o can be slow.
You may also be seeing some roundoff if things are other than literals.
.
- References:
- CDC Floating point = tests?
- From: stocksami@xxxxxxxxxxxxx
- CDC Floating point = tests?
- Prev by Date: F77 -> F95 Intro Presentation Material
- Next by Date: Re: CDC Floating point = tests?
- Previous by thread: CDC Floating point = tests?
- Next by thread: Re: CDC Floating point = tests?
- Index(es):
Relevant Pages
|