[MLton-devel] cvs commit: (almost) full support for Real32

Stephen Weeks MLton@mlton.org
Fri, 25 Jul 2003 22:38:25 -0700


>   Both Real32 and Real64 are implemented by a Real functor.  So, I'm not
>   100% sure that Real32.{toDecimal,fmt,toString,{to,from}LargeInt} are
>   correct.

toDecimal, fmt, and toString should be fine, since Real64 has more
bits.

fromLargeInt is almost certainly broken -- I see a hardwired constant
of 1024 in there.  

toLargeInt needs checking as well.

I've added to my todo to generalize the real.sml regression to work
for both Real32 and Real64.

>   I don't know exactly how Real64_gdtoa works, so I don't know if my
>   implementation of Real32_gdtoa by casting to Real64 is correct.

Again, this seems correct since you're not losing any precision in the
cast.

>   That means the Real32.* will really be carried out at much higher
>   precision than it should be.  The -native-strict-ieee true should
>   solve it, at the penalty of writing every floating point result to
>   memory.

Seems good to me.

> Isn't carrying things out to full precision technically incorrect?
> Mote than just the precision, it also means things won't get
> converted to infinity.

Yes, but it seems consistent with how we implement Real64.  And if you
wanna pay, you can use -ieee-fp true.  I'll add a note to the basis
library section of the user guide explaining the situation.



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel