You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 5222 Reporter: Pascal Cuoq Assigned to:@xavierleroy Status: closed (set by @xavierleroy on 2012-09-25T18:06:17Z) Resolution: fixed Priority: normal Severity: major Version: 3.12.0 Category: ~DO NOT USE (was: OCaml general) Related to:#5225 Monitored by: bobot till "Julien Signoles" @dbuenzli
Hashtbl.hash x associates a positive integer to any value of any type. It is guaranteed that if x = y or Pervasives.compare x y = 0, then hash x = hash y.
But:
Objective Caml version 3.12.0
Hashtbl.hash (+0.) ;;
: int = 0
Hashtbl.hash (-0.) ;;
: int = 128
(+0.) = (-0.) ;;
: bool = true
The text was updated successfully, but these errors were encountered:
As part of a major overhaul of the generic hash function, fixed the +0.0/-0.0 issue, and also made sure that all NaNs hash to the same value. The code is in SVN trunk and should go into release 3.13.
Original bug ID: 5222
Reporter: Pascal Cuoq
Assigned to: @xavierleroy
Status: closed (set by @xavierleroy on 2012-09-25T18:06:17Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 3.12.0
Category: ~DO NOT USE (was: OCaml general)
Related to: #5225
Monitored by: bobot till "Julien Signoles" @dbuenzli
Bug description
According to http://caml.inria.fr/pub/docs/manual-ocaml/libref/Hashtbl.html :
Hashtbl.hash x associates a positive integer to any value of any type. It is guaranteed that if x = y or Pervasives.compare x y = 0, then hash x = hash y.
But:
Hashtbl.hash (+0.) ;;
Hashtbl.hash (-0.) ;;
(+0.) = (-0.) ;;
The text was updated successfully, but these errors were encountered: