From 25247ee4b5cff30608f9eda8ba54663dd156a249 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Thu, 7 Jun 2012 00:48:43 +0900 Subject: [PATCH] Fixing integer-length for bignums. --- lib/srfi/33/bit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/srfi/33/bit.c b/lib/srfi/33/bit.c index ddc32686..06d90703 100644 --- a/lib/srfi/33/bit.c +++ b/lib/srfi/33/bit.c @@ -267,7 +267,7 @@ static sexp sexp_integer_length (sexp ctx, sexp self, sexp_sint_t n, sexp x) { } else if (sexp_bignump(x)) { hi = sexp_bignum_hi(x); return sexp_make_fixnum(integer_log2(sexp_bignum_data(x)[hi]) - + hi*sizeof(sexp_uint_t)); + + hi*sizeof(sexp_uint_t)*CHAR_BIT); #endif } else { return sexp_type_exception(ctx, self, SEXP_FIXNUM, x);