From bfba360589c4816ac89ff3cf0895591a3bbc3b43 Mon Sep 17 00:00:00 2001 From: simonm Date: Wed, 6 May 1998 12:15:10 +0000 Subject: [PATCH] [project @ 1998-05-06 12:15:10 by simonm] - one `quotRem` is faster than separate `quot` and `rem` on Integers. --- ghc/lib/std/PrelNum.lhs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- 1.7.10.4