From 229a5ca3c4cfe533407567de2c745d26a306d391 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 11 Dec 2011 09:50:51 -0800 Subject: * arith.c: Regenerated. * arith.txr (normalize): Bugfix: was not turning +/- NUM_MAX bignums into fixnums. --- arith.txr | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'arith.txr') diff --git a/arith.txr b/arith.txr index 736645da..cba98be2 100644 --- a/arith.txr +++ b/arith.txr @@ -79,16 +79,12 @@ static val bignum_dbl_ipt(double_intptr_t di) static val normalize(val bignum) { - switch (mp_cmp_mag(mp(bignum), &NUM_MAX_MP)) { - case MP_EQ: - case MP_GT: + if (mp_cmp_mag(mp(bignum), &NUM_MAX_MP) == MP_GT) { return bignum; - default: - { - cnum fixnum; - mp_get_intptr(mp(bignum), &fixnum); - return num(fixnum); - } + } else { + cnum fixnum; + mp_get_intptr(mp(bignum), &fixnum); + return num(fixnum); } } -- cgit v1.2.3