[MLton-commit] r6241

Matthew Fluet fluet at mlton.org
Fri Dec 7 13:15:37 PST 2007


Regression demonstrating bug in algebraic simplification of Real_lt and Real_le primitives
----------------------------------------------------------------------

A   mlton/trunk/regression/real-algsimp.ok
A   mlton/trunk/regression/real-algsimp.sml

----------------------------------------------------------------------

Added: mlton/trunk/regression/real-algsimp.ok
===================================================================
--- mlton/trunk/regression/real-algsimp.ok	2007-12-05 16:09:11 UTC (rev 6240)
+++ mlton/trunk/regression/real-algsimp.ok	2007-12-07 21:15:36 UTC (rev 6241)
@@ -0,0 +1,14 @@
+false
+false
+false
+false
+false
+true
+true
+false
+false
+false
+false
+false
+true
+true

Added: mlton/trunk/regression/real-algsimp.sml
===================================================================
--- mlton/trunk/regression/real-algsimp.sml	2007-12-05 16:09:11 UTC (rev 6240)
+++ mlton/trunk/regression/real-algsimp.sml	2007-12-07 21:15:36 UTC (rev 6241)
@@ -0,0 +1,37 @@
+val one = valOf (Real.fromString "1.0")
+val zero = valOf (Real.fromString "0.0")
+val posInf = one / zero
+val negInf = ~one / zero
+
+val nan1 = posInf + negInf
+
+fun cmp f = print ((Bool.toString (f (nan1, nan1))) ^ "\n")
+
+local
+   open Real
+in
+   val _ = cmp (op <)
+   val _ = cmp (op <=)
+   val _ = cmp (op >)
+   val _ = cmp (op >=)
+   val _ = cmp (op ==)
+   val _ = cmp (op !=)
+   val _ = cmp (op ?=)
+end
+
+
+val nan2 = valOf (Real.fromString "nan")
+
+fun cmp f = print ((Bool.toString (f (nan1, nan2))) ^ "\n")
+
+local
+   open Real
+in
+   val _ = cmp (op <)
+   val _ = cmp (op <=)
+   val _ = cmp (op >)
+   val _ = cmp (op >=)
+   val _ = cmp (op ==)
+   val _ = cmp (op !=)
+   val _ = cmp (op ?=)
+end




More information about the MLton-commit mailing list