summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-01-18 10:20:05 -0800
committerKaz Kylheku <kaz@kylheku.com>2019-01-18 10:20:05 -0800
commit4eaace0cddfc34b2a8f5d16faf41909ef9033cb7 (patch)
tree8f0cbfb1619af80a478ea82fa69a5c1433e9a36c
parent6c8b83de506a6d71024d4a6aaa35456cba58ebb8 (diff)
downloadtxr-4eaace0cddfc34b2a8f5d16faf41909ef9033cb7.tar.gz
txr-4eaace0cddfc34b2a8f5d16faf41909ef9033cb7.tar.bz2
txr-4eaace0cddfc34b2a8f5d16faf41909ef9033cb7.zip
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.
-rw-r--r--arith.c2
1 files changed, 1 insertions, 1 deletions
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);