From 40bae281a56c9e305852905dcbd29125de388b25 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 1 Oct 2012 17:35:10 -0700 Subject: * arith.c (bignum_from_long): New function. * arith.h (bignum_from_long): Declared. * lib.c (int_str): Streamlined. Only use mp_read_radix in the case when wcstol fails, because now we have bignum_from_long to handle all values of long. Ensure that the bignum is normalized, in case it falls in the fixnum range (does not happen on our usual platforms). --- arith.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arith.h') diff --git a/arith.h b/arith.h index 52aad603..8a97dd87 100644 --- a/arith.h +++ b/arith.h @@ -26,6 +26,7 @@ val make_bignum(void); val bignum(cnum cn); +val bignum_from_long(long l); int highest_bit(int_ptr_t n); val normalize(val bignum); val in_int_ptr_range(val bignum); -- cgit v1.2.3