projects
/
ghc-base.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a08bde2
)
Fix typo in floatToDigits
author
Daniel Fischer
<daniel.is.fischer@web.de>
Sun, 24 Oct 2010 18:50:41 +0000
(18:50 +0000)
committer
Daniel Fischer
<daniel.is.fischer@web.de>
Sun, 24 Oct 2010 18:50:41 +0000
(18:50 +0000)
The mDn value for powers of 2 >= floatDigits x - 1 was typo'ed, leading to longer than necessary show results in a few cases (e.g. 2.0^852).
Corrected in accordance with Burger and Dybvig's paper.
GHC/Float.lhs
patch
|
blob
|
history
diff --git
a/GHC/Float.lhs
b/GHC/Float.lhs
index
aa2a534
..
e0cc415
100644
(file)
--- a/
GHC/Float.lhs
+++ b/
GHC/Float.lhs
@@
-600,7
+600,7
@@
floatToDigits base x =
if e >= 0 then
let be = expt b e in
if f == expt b (p-1) then
- (f*be*b*2, 2*b, be*b, b)
+ (f*be*b*2, 2*b, be*b, be) -- according to Burger and Dybvig
else
(f*be*2, 2, be, be)
else