From 8db9cc6cf3686c9ec75600325b13bb70fc608a48 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Mon, 7 Apr 2003 01:51:10 +0000 Subject: [PATCH] * random.c: #include gmp.h. (scm_c_random_bignum): normalize result on return. --- libguile/random.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libguile/random.c b/libguile/random.c index c07a68856..9e453abca 100644 --- a/libguile/random.c +++ b/libguile/random.c @@ -24,6 +24,7 @@ #include "libguile/_scm.h" +#include #include #include #include @@ -262,9 +263,6 @@ scm_c_random_bignum (scm_t_rstate *state, SCM m) (unsigned long *) scm_gc_calloc (num_chunks * sizeof (unsigned long), "random bignum chunks"); - /* FIXME: what about chance that bignums end up with zeroes at the - front? -- do we need to normalize? */ - do { unsigned long *current_chunk = random_chunks + (num_chunks - 1); @@ -303,7 +301,7 @@ scm_c_random_bignum (scm_t_rstate *state, SCM m) scm_gc_free (random_chunks, num_chunks * sizeof (unsigned long), "random bignum chunks"); - return result; + return scm_i_normbig (result); } /*