summaryrefslogtreecommitdiffstats
path: root/rand.c
Commit message (Collapse)AuthorAgeFilesLines
* * match.c (LOG_MATCH): Use < in format directive instead of -.Kaz Kylheku2011-12-281-1/+2
| | | | * rand.c (random): Add back missing declaration.
* * rand.c (make_state): Use ANSI C syntax for prototyped function of noKaz Kylheku2011-12-271-2/+1
| | | | | | arguments. This snuck through due to working with a C++ compiler. (random): Fixed unused variable warning that happens on 32-bit-pointer platforms.
* * rand.c (rand32): Moved.Kaz Kylheku2011-12-231-21/+25
| | | | | | (make_random_state): After initializing, retrieve eight random numbers to clear pathological initial behavior leading to duplicate values.
* * arith.c (highest_bit): Changing to external linkage.Kaz Kylheku2011-12-231-19/+48
| | | | | | | | * arith.h (highest_bit): Declared. * rand.c (random): Rewrote using different algorithm which ensures even distribution, and avoids doing a bignum mod operation.
* * rand.c (random): Fix for 64 bit fixnums: stick two random numbersKaz Kylheku2011-12-221-0/+4
| | | | | together. Otherwise for fixnum moduli, we get only a 32 bit number no matter what the modulus is.
* * arith.c (normalize): Linkage changed to extern.Kaz Kylheku2011-12-211-1/+1
| | | | | | | | * arith.h (normalize): Declared. * rand.c (random): Bugfix: normalize the bignum before returning it. * txr.1: Doc stubs for PRNG functionality.
* * rand.c: Added comment about source of algorithm.Kaz Kylheku2011-12-211-0/+4
|
* * rand.c (random): Bugfix: not building up sufficiently large bignums.Kaz Kylheku2011-12-211-3/+12
| | | | Work properly when mp_digit is smaller than 32 bits.
* * Makefile (OBJS): new object file, rand.o.Kaz Kylheku2011-12-211-0/+199
* eval.c: Includes rand.h header. (eval_init): New variable and functions from rand module registered. * lib.c: Includes rand.h header. (init): Call rand_init. * rand.c: New file. * rand.h: New file.