mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-15 13:52:16 -08:00
random_integer() did not work when the input was a fixnum (src/c/num_rand.d).
This commit is contained in:
parent
c89d2c0ffb
commit
5aac759ad1
2 changed files with 11 additions and 1 deletions
|
|
@ -1,3 +1,10 @@
|
|||
ECL 9.12.2:
|
||||
===========
|
||||
|
||||
* Bugs fixed:
|
||||
|
||||
- RANDOM broken on 64-bits architectures.
|
||||
|
||||
ECL 9.12.1:
|
||||
===========
|
||||
|
||||
|
|
|
|||
|
|
@ -155,7 +155,10 @@ random_integer(cl_object limit, cl_object state)
|
|||
{
|
||||
#ifdef WITH_GMP
|
||||
cl_index bit_length = fix(cl_integer_length(limit));
|
||||
cl_object buffer = ecl_ash(MAKE_FIXNUM(1), bit_length);
|
||||
cl_object buffer;
|
||||
if (bit_length <= FIXNUM_BITS)
|
||||
bit_length = FIXNUM_BITS;
|
||||
buffer = ecl_ash(MAKE_FIXNUM(1), bit_length);
|
||||
for (bit_length = buffer->big.big_size; bit_length--; ) {
|
||||
buffer->big.big_limbs[bit_length] =
|
||||
generate_limb(state);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue