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:
a0d5973
)
markup fix to Data.HashTable
author
Ross Paterson
<ross@soi.city.ac.uk>
Sat, 12 Aug 2006 10:38:35 +0000
(10:38 +0000)
committer
Ross Paterson
<ross@soi.city.ac.uk>
Sat, 12 Aug 2006 10:38:35 +0000
(10:38 +0000)
Data/HashTable.hs
patch
|
blob
|
history
diff --git
a/Data/HashTable.hs
b/Data/HashTable.hs
index
fda647e
..
f78f0cc
100644
(file)
--- a/
Data/HashTable.hs
+++ b/
Data/HashTable.hs
@@
-192,6
+192,7
@@
golden = -1640531527
-- implemented by extracting the uppermost 32 bits of the 64-bit
-- result of multiplying by a 32-bit constant. The constant is from
-- Knuth, derived from the golden ratio:
+--
-- > golden = round ((sqrt 5 - 1) * 2^31) :: Int
hashInt :: Int -> Int32
hashInt x = mulHi (fromIntegral x) golden