From 65ac645cd052bd307f9e2001a5b7084cfa1a01dd Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Fri, 14 Dec 2018 15:18:04 +0000 Subject: [PATCH] Use integer bit tests in FLONUM-IS-NEGATIVE?. Otherwise this raises an exception for sNaN on i387. --- src/microcode/flonum.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/microcode/flonum.c b/src/microcode/flonum.c index 14bcb943e..b79ea6349 100644 --- a/src/microcode/flonum.c +++ b/src/microcode/flonum.c @@ -525,7 +525,9 @@ DEFINE_PRIMITIVE ("FLONUM-IS-NORMAL?", Prim_flonum_is_normal_p, 1, 1, 0) DEFINE_PRIMITIVE ("FLONUM-IS-NEGATIVE?", Prim_flonum_is_negative_p, 1, 1, 0) { PRIMITIVE_HEADER (1); - PRIMITIVE_RETURN (BOOLEAN_TO_OBJECT (signbit (arg_flonum (1)))); + PRIMITIVE_RETURN + (BOOLEAN_TO_OBJECT + ((UINT64_C (0x8000000000000000)) & (arg_flonum_binary64 (1)))); } DEFINE_PRIMITIVE ("FLONUM-IS-GREATER?", Prim_flonum_is_greater_p, 2, 2, 0) -- 2.25.1