[project @ 1998-05-06 12:15:10 by simonm]
authorsimonm <unknown>
Wed, 6 May 1998 12:15:10 +0000 (12:15 +0000)
committersimonm <unknown>
Wed, 6 May 1998 12:15:10 +0000 (12:15 +0000)
- one `quotRem` is faster than separate `quot` and `rem` on Integers.

ghc/lib/std/PrelNum.lhs

index 679329a..0c7834a 100644 (file)
@@ -848,7 +848,9 @@ jtos' n cs
   = if n < 10 then
        chr (fromInteger (n + ord_0)) : cs
     else 
-       jtos' (n `quot` 10) (chr (toInt (n `rem` 10) + (ord_0::Int)) : cs)
+       jtos' q (chr (toInt r + (ord_0::Int)) : cs)
+  where
+    (q,r) = n `quotRem` 10
 
 showFloat x  =  showString (formatRealFloat FFGeneric Nothing x)