From 04ef5fd846cc43c3b97e5dee9ab102e2e2740608 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 18 Jan 2019 10:20:05 -0800 Subject: int-flo: fix always-false test. * arith.c (int_flo): Fix reversed inequality tests which cause the test to be always false. This always false test prevents use of the faster code path for converting floating-point point values that are in range of the cptr type. --- arith.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arith.c b/arith.c index 0bd56f30..1420d65d 100644 --- a/arith.c +++ b/arith.c @@ -2362,7 +2362,7 @@ val int_flo(val f) val self = lit("int-flo"); double d = c_flo(f, self); - if (d >= INT_PTR_MAX && d <= INT_PTR_MIN - 1) { + if (d >= INT_PTR_MIN - 1 && d <= INT_PTR_MAX) { cnum n = d; if (n < NUM_MIN || n > NUM_MAX) return bignum(n); -- cgit v1.2.3