Sven Panne wrote:
> (As an aside: I *hate* standards which are not freely
> available, I've never seen a real IEEE-754 document. A $4000 annual
> subscription price for a single person is ridiculous, and I would probably
> have slight problems persuade my company to buy the $40.000 enterprise
> subscription...)
I agree about this.  The GHC people based at Cambridge do however have
access to a real copy of IEEEE754, since there is one in the CL library there,
or at any rate was about 2 years ago.  But you can probably find out everything
you want to know on Kahan's Web page:
   http://HTTP.CS.Berkeley.EDU/~wkahan/

Fergus Henderson wrote
> If all the platforms that GHC target use the same IEEE arithmetic
> and representation for Float/Double, why does GHC need to use
> Rational to represent floating pointer values?
Unfortunately they probably don't.  About the only platform I can think
of which is fully IEEE-conformant by default is Sparc/Solaris.  On Intel things
are done in extra precision and can then be rounded (I presume you can
construct perverse cases where this rounding goes completely wrong).  On Alphas
IEEE 754 conformance requires insertion of trap barriers so overflows can
be handled properly.  cc only does this when you give it an obscure
option no-one uses, and as far as I know gcc can't do it at all.  So my
opinion is that GHC should attempt no FP constant folding at all when 
cross-compiling.  It is probably just as well that the Haskell standard does
not insist on IEEE754, as it might be difficult to guarantee.

Reply via email to