From 38abf85defad8a15899687e35c7037bb2ddf42b0 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 10 Apr 2012 16:11:15 -0700 Subject: * arith.c (INT_PTR_MAX_MP): New static variable. (in_int_ptr_range): New function. (arith_init): Initialize INT_PTR_MAX_MP. * arith.h (in_int_ptr_range): Declared. * lib.c (c_num): Allow bignums to be converted to a cnum, if they are in range, rather than allowing only fixnums. * rand.c (make_random_state): Now that we have such a function, initialize random seed using time value from time_sec_usec rather than from time and clock. clock is bad for random seeding because it measures virtual time since the start of the process. --- arith.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arith.h') diff --git a/arith.h b/arith.h index 91e197e0..52aad603 100644 --- a/arith.h +++ b/arith.h @@ -28,4 +28,5 @@ val make_bignum(void); val bignum(cnum cn); int highest_bit(int_ptr_t n); val normalize(val bignum); +val in_int_ptr_range(val bignum); void arith_init(void); -- cgit v1.2.3