[MLton] Re: [MLton-commit] r5662

Matthew Fluet fluet at tti-c.org
Thu Jun 21 13:16:59 PDT 2007


Henry Cejtin wrote:
> I agree that the notion of bitwise-equality of reals is useful, just that it
> should not be Real.==.  On the other hand, if there were a cheap conversion
> to Word? (and Word?'s that were large enough) then that would be good enough
> I think.

SVN now has
   MLton.Real32.castFromWord : Word32.word -> Real32.real
   MLton.Real32.castToWord : Real32.real -> Word32.word
   MLton.Real64.castFromWord : Word64.word -> Real64.real
   MLton.Real64.castToWord : Real64.real -> Word64.word
They are currently expanded to C calls in the x86 codegen (but they are 
implemented directly in the amd64 codegen).  The x86 codegen could be 
extended to implement then directly.

> Speaking of reals, it would be nice if there were a Real type for the full
> 80-bit reals.  Gcc gives you this with `long double'.

Only on some platforms.  On MacOSX, long double is 128-bit IEEE, albeit 
without hardware support.





More information about the MLton mailing list