From: simonm Date: Wed, 6 May 1998 12:15:10 +0000 (+0000) Subject: [project @ 1998-05-06 12:15:10 by simonm] X-Git-Tag: Approx_2487_patches~723 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=bfba360589c4816ac89ff3cf0895591a3bbc3b43;p=ghc-hetmet.git [project @ 1998-05-06 12:15:10 by simonm] - one `quotRem` is faster than separate `quot` and `rem` on Integers. --- diff --git a/ghc/lib/std/PrelNum.lhs b/ghc/lib/std/PrelNum.lhs index 679329a..0c7834a 100644 --- a/ghc/lib/std/PrelNum.lhs +++ b/ghc/lib/std/PrelNum.lhs @@ -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)