projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e7833e5
)
[project @ 1998-05-06 12:15:10 by simonm]
author
simonm
<unknown>
Wed, 6 May 1998 12:15:10 +0000
(12:15 +0000)
committer
simonm
<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
patch
|
blob
|
history
diff --git
a/ghc/lib/std/PrelNum.lhs
b/ghc/lib/std/PrelNum.lhs
index
679329a
..
0c7834a
100644
(file)
--- 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)