caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Hashtbl.hash and Hashtbl.hash_param
@ 2002-08-23 15:24 sebastien FURIC
  2002-08-23 15:45 ` sebastien FURIC
  2002-08-27  8:24 ` Xavier Leroy
  0 siblings, 2 replies; 7+ messages in thread
From: sebastien FURIC @ 2002-08-23 15:24 UTC (permalink / raw)
  To: OCaml Mailing list


 What kind of algorithm is used to compute the hash code of objects in
O'Caml ?

 Hashtbl.hash (List.map (fun x -> Random.int 100)
[1;2;3;4;5;6;7;8;9;10]);;
 always returns 0 (Hashtbl.hash_param has the same properties) which is
a poor result !

 What can I do if I don't know the size of the list in advance ?

 Cheers,

 Sebastien.
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-08-27 16:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-23 15:24 [Caml-list] Hashtbl.hash and Hashtbl.hash_param sebastien FURIC
2002-08-23 15:45 ` sebastien FURIC
2002-08-23 16:27   ` Florian Douetteau
2002-08-27  8:24 ` Xavier Leroy
2002-08-27  9:59   ` jeanmarc.eber
2002-08-27 10:58     ` Alain Frisch
2002-08-27 16:12   ` Blair Zajac

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).