Explain how the GOLDEN_RATIO constant was calculated.

git-svn-id: svn://10.0.0.236/trunk@140979 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
wtc%netscape.com 2003-04-10 18:10:12 +00:00
parent 0eb4f1e6aa
commit b3ad5c438f

View File

@ -179,7 +179,7 @@ PL_HashTableDestroy(PLHashTable *ht)
/*
** Multiplicative hash, from Knuth 6.4.
*/
#define GOLDEN_RATIO 0x9E3779B9U
#define GOLDEN_RATIO 0x9E3779B9U /* 2/(1+sqrt(5))*(2^32) */
PR_IMPLEMENT(PLHashEntry **)
PL_HashTableRawLookup(PLHashTable *ht, PLHashNumber keyHash, const void *key)