Re: CDC Floating point = tests?



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.



.



Relevant Pages

  • Re: Integer to Double conversion
    ... > IntToExtended or Int64ToExtended conversion function. ... > is compiler supported the code is generated inline. ... > floating point arithmetic. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Im not the only one who values interval-arithmetic
    ... I see rounding mode discussed in regard to floating ... It's only used by the compiler ... name of the package and something about how it works? ... coerced to an interval by mapping NUM -> before some ...
    (comp.lang.lisp)
  • Re: Hercules
    ... Although D-format floating point does use 64 bits to represent a floating point number, I don't call the instructions which process these numbers "64-bit instructions". ... In PL/I terms, instruction I received way back when indicated that FLOAT DECwas the way to go to use E-format in the compiled code, and FLOAT DECwas the way to go to use D-format in the compiled code. ... My reference to Fujitsu was simply to record my experience that Fj had gone to the trouble of making their PL/I compiler sufficiently "plug compatible" with IBM's Optimizing compiler that ...
    (comp.lang.pl1)
  • Re: Simple Random Number Generator/Function - Cliff RNG
    ... Tim and Alex: ... This has certainly informed me greatly on this 'PRNG'. ... PRNGs with the extra baggage of this floating point fuzziness! ... not just the compiler. ...
    (sci.math)
  • Re: Modelling Disjoint Subtypes
    ... plus sign is represented by a floating point addition operation. ... In the case of a Java compiler, ... two multiplies (x.numerator * y.numerator, ... because temperature does not inherently have ratio. ...
    (comp.databases.theory)