File tree 2 files changed +22
-6
lines changed
compiler/tests-ocaml/lib-hashtbl
2 files changed +22
-6
lines changed Original file line number Diff line number Diff line change 12
12
-0.0 07be548a
13
13
+infty 23ea56fb
14
14
-infty 059f7872
15
- NaN 23498e72
16
- NaN#2 23498e72
17
- NaN#3 23498e72
15
+ NaN 3228858d
16
+ NaN#2 3228858d
17
+ NaN#3 3228858d
18
18
-- Native integers:
19
19
0 07be548a
20
20
-1 3653e015
Original file line number Diff line number Diff line change @@ -41,9 +41,25 @@ function caml_hash_mix_final(h) {
41
41
}
42
42
43
43
//Provides: caml_hash_mix_float
44
- //Requires: caml_int64_bits_of_float, caml_hash_mix_int64
45
- function caml_hash_mix_float ( h , v0 ) {
46
- return caml_hash_mix_int64 ( h , caml_int64_bits_of_float ( v0 ) ) ;
44
+ //Requires: caml_int64_bits_of_float
45
+ //Requires: caml_hash_mix_int
46
+ //Requires: caml_int64_lo32, caml_int64_hi32
47
+ function caml_hash_mix_float ( hash , v0 ) {
48
+ var i64 = caml_int64_bits_of_float ( v0 ) ;
49
+ var l = caml_int64_lo32 ( i64 ) ;
50
+ var h = caml_int64_hi32 ( i64 ) ;
51
+ /* Normalize NaNs */
52
+ if ( ( h & 0x7FF00000 ) == 0x7FF00000 && ( l | ( h & 0xFFFFF ) ) != 0 ) {
53
+ h = 0x7FF00000 ;
54
+ l = 0x00000001 ;
55
+ }
56
+ /* Normalize -0 into +0 */
57
+ else if ( h == ( 0x80000000 | 0 ) && l == 0 ) {
58
+ h = 1 ;
59
+ }
60
+ hash = caml_hash_mix_int ( hash , l ) ;
61
+ hash = caml_hash_mix_int ( hash , h ) ;
62
+ return hash ;
47
63
}
48
64
//Provides: caml_hash_mix_int64
49
65
//Requires: caml_hash_mix_int
You can’t perform that action at this time.
0 commit comments