From: Taylor R Campbell Date: Fri, 14 Dec 2018 15:18:04 +0000 (+0000) Subject: Use integer bit tests in FLONUM-IS-NEGATIVE?. X-Git-Tag: mit-scheme-pucked-10.1.9~3^2~35^2~18 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=65ac645cd052bd307f9e2001a5b7084cfa1a01dd;p=mit-scheme.git Use integer bit tests in FLONUM-IS-NEGATIVE?. Otherwise this raises an exception for sNaN on i387. --- 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)