Explain how the GOLDEN_RATIO constant was calculated.

This commit is contained in:
wtc%netscape.com 2003-04-10 18:10:12 +00:00
parent 2555b01f28
commit afab90e1d6

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)