mp_get_i32 already handles the sign

This commit is contained in:
Justin Ethier 2019-10-22 16:39:00 -04:00
parent 03abd758b5
commit 25acf652c2

View file

@ -1496,10 +1496,7 @@ object Cyc_bignum_normalize(void *data, object n)
if (mp_cmp_mag(&bignum_value(n), &bn) == MP_GT) { if (mp_cmp_mag(&bignum_value(n), &bn) == MP_GT) {
result = n; result = n;
} else { } else {
i = (int)mp_get_u32(&bignum_value(n)); i = mp_get_i32(&bignum_value(n));
if ((&bignum_value(n))->sign == MP_NEG) {
i = -i;
}
result = obj_int2obj(i); result = obj_int2obj(i);
} }
mp_clear(&bn); mp_clear(&bn);