[MLton-user] bug with floating-point division on x86/Mac OS X
Vesa Karvonen
vesa.a.j.k at gmail.com
Sun May 31 06:00:14 PDT 2009
Fixed in the SVN: http://mlton.org/pipermail/mlton-commit/2009-May/003108.html .
-Vesa Karvonen
On Sat, May 30, 2009 at 10:31 PM, John Reppy <jhr at cs.uchicago.edu> wrote:
> The code generation for floating-point division is broken in certain
> situations
> on the x86 (Mac OS X). Here is a small program that demonstrates the bug:
>
> structure R = Real64 (* or Real32 *)
>
> fun f (a, b) = let
> val c = a / b
> in
> print(concat[R.toString a, "/", R.toString b, " = ", R.toString c,
> "\n"])
> end;
>
> val _ = List.app f [(0.5, 2.0), (0.5, 130.0)];
>
> It prints:
>
> 0.5/2 = 4
> 0.5/130 = 260
>
> when it should print something like
>
> 0.5/2 = 0.25
> 0.5/130 = 0.00384615384615
>
> The MLton version is revision 7103 from svn and I'm running on Mac OS X
> 10.5.7.
> The bug affects both 32 and 64-bit floats.
>
> - John
>
>
> _______________________________________________
> MLton-user mailing list
> MLton-user at mlton.org
> http://mlton.org/mailman/listinfo/mlton-user
>
More information about the MLton-user
mailing list