[MLton-commit] r4728

Vesa Karvonen vesak at mlton.org
Thu Oct 19 00:08:44 PDT 2006


Optimized implementation of isEven (after suggestion by Stephen Weeks).

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

U   mltonlib/trunk/com/ssh/extended-basis/unstable/mk-integer-ext.fun

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

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-integer-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mk-integer-ext.fun	2006-10-18 22:00:11 UTC (rev 4727)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-integer-ext.fun	2006-10-19 07:08:43 UTC (rev 4728)
@@ -15,7 +15,7 @@
       val large = (toLarge, fromLarge)
       val string = (toString, fromString)
       fun is0 i = fromInt 0 = i
-      fun isEven i = is0 (i mod fromInt 2)
+      fun isEven i = is0 (rem (i, fromInt 2))
       val isOdd = not o isEven
       val bounds = case (minInt, maxInt) of
                       (NONE, NONE) => NONE




More information about the MLton-commit mailing list