summaryrefslogtreecommitdiffstats
path: root/rand.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2011-12-21 15:40:22 -0800
committerKaz Kylheku <kaz@kylheku.com>2011-12-21 15:40:22 -0800
commitb4b045a8e7c65783d94812553e31ae0282e80cc4 (patch)
treedf16340ae5e8280f0ecdc36d2c7697fc478b96ec /rand.c
parent13a8820a0979787bd16f530a400da69c798e954e (diff)
downloadtxr-b4b045a8e7c65783d94812553e31ae0282e80cc4.tar.gz
txr-b4b045a8e7c65783d94812553e31ae0282e80cc4.tar.bz2
txr-b4b045a8e7c65783d94812553e31ae0282e80cc4.zip
* arith.c (normalize): Linkage changed to extern.
* arith.h (normalize): Declared. * rand.c (random): Bugfix: normalize the bignum before returning it. * txr.1: Doc stubs for PRNG functionality.
Diffstat (limited to 'rand.c')
-rw-r--r--rand.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rand.c b/rand.c
index 0b811b9f..2e504514 100644
--- a/rand.c
+++ b/rand.c
@@ -192,7 +192,7 @@ val random(val state, val modulus)
err = mp_mod(om, m, om);
if (err != MP_OKAY)
goto invalid;
- return out;
+ return normalize(out);
} else if (fixnump(modulus)) {
cnum m = c_num(modulus);
if (m <= 0)