File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -328,18 +328,22 @@ let float64 _ f =
328328 match classify_float f with
329329 | FP_normal | FP_subnormal | FP_zero -> Printf. sprintf " %h" f
330330 | FP_nan ->
331+ let f = Int64. (bits_of_float f) in
331332 Printf. sprintf
332- " nan:0x%Lx"
333- Int64. (logand (bits_of_float f) (of_int ((1 lsl 52 ) - 1 )))
333+ " %snan:0x%Lx"
334+ (if Int64. ( > = ) f 0L then " " else " -" )
335+ Int64. (logand f (of_int ((1 lsl 52 ) - 1 )))
334336 | FP_infinite -> if Float. (f > 0. ) then " inf" else " -inf"
335337
336338let float32 _ f =
337339 match classify_float f with
338340 | FP_normal | FP_subnormal | FP_zero -> Printf. sprintf " %h" f
339341 | FP_nan ->
342+ let f = Int32. (bits_of_float f) in
340343 Printf. sprintf
341- " nan:0x%lx"
342- Int32. (logand (bits_of_float f) (of_int ((1 lsl 23 ) - 1 )))
344+ " %snan:0x%lx"
345+ (if Int32. ( > = ) f 0l then " " else " -" )
346+ Int32. (logand f (of_int ((1 lsl 23 ) - 1 )))
343347 | FP_infinite -> if Float. (f > 0. ) then " inf" else " -inf"
344348
345349let expression_or_instructions ctx st in_function =
You can’t perform that action at this time.
0 commit comments