If I remember correctly it used to be the case in older versions of OCaml, but
it changed because of the standard behavior expected from NaN float values.
The comparison of a NaN value with any other float should always return false,
and therefore the structural comparison of any data structure containing a NaN
with itself should also return false:
# let x = Some [ nan ];;
val x : float list option = Some [nan]
# x = x;;
- : bool = false
# x == x;;
- : bool = true
The solution to your problem is to use Pervasives.compare instead of the
comparison operators:
# compare x x;;
- : int = 0
Martin
_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs