File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -1048,7 +1048,8 @@ module Stats = struct
10481048
10491049 let float_tests = (* Float.frexp nan (and infinity) is undefined and may return a 32766 exponent on Alpine *)
10501050 let float_expon_dist = (" exponent" , fun f -> if Float. (is_nan f || is_infinite f) then 0 else snd (Float. frexp f)) in
1051- let float_signif_dist = (" significant" , fun f -> let s = fst (Float. frexp f) in int_of_float (s *. 1000000. )) in
1051+ let float_signif_dist = (" significant" , fun f -> if Float. (is_nan f || is_infinite f) (* int_of_float is undefined on nan and infinity *)
1052+ then 0 else let s = fst (Float. frexp f) in int_of_float (s *. 1000000. )) in
10521053 let float_fpclass f = match Float. classify_float f with
10531054 | FP_normal -> " FP_normal"
10541055 | FP_subnormal -> " FP_subnormal"
Original file line number Diff line number Diff line change @@ -1111,9 +1111,10 @@ module Stats = struct
11111111 Test. make ~name: " exponential -10. dist" ~count: 5_000 (add_stat float_dist (exponential (- 10. ))) (fun _ -> true );
11121112 ]
11131113
1114- let float_tests =
1114+ let float_tests = (* Float.frexp nan (and infinity) is undefined and may return a 32766 exponent on Alpine *)
11151115 let float_expon_dist = (" exponent" , fun f -> if Float. (is_nan f || is_infinite f) then 0 else snd (Float. frexp f)) in
1116- let float_signif_dist = (" significant" , fun f -> let s = fst (Float. frexp f) in int_of_float (s *. 1000000. )) in
1116+ let float_signif_dist = (" significant" , fun f -> if Float. (is_nan f || is_infinite f) (* int_of_float is undefined on nan and infinity *)
1117+ then 0 else let s = fst (Float. frexp f) in int_of_float (s *. 1000000. )) in
11171118 let float_fpclass f = match Float. classify_float f with
11181119 | FP_normal -> " FP_normal"
11191120 | FP_subnormal -> " FP_subnormal"
You can’t perform that action at this time.
0 commit comments