aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/aggcat.spad.pamphlet
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr@axiomatics.org>2015-12-31 14:56:12 -0800
committerGabriel Dos Reis <gdr@axiomatics.org>2015-12-31 14:56:12 -0800
commitf51aee83708673ef9941174951bec9aee80cb03c (patch)
tree4d8cfccd653dfa09819234bc61a8775091e4f1e6 /src/algebra/aggcat.spad.pamphlet
parent039d244dbef31e4ca6d34d2cf42b58b41a572884 (diff)
downloadopen-axiom-f51aee83708673ef9941174951bec9aee80cb03c.tar.gz
Avoid modulus bias in 'random()' usage.
Diffstat (limited to 'src/algebra/aggcat.spad.pamphlet')
-rw-r--r--src/algebra/aggcat.spad.pamphlet2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/algebra/aggcat.spad.pamphlet b/src/algebra/aggcat.spad.pamphlet
index 71db9681..f94297c8 100644
--- a/src/algebra/aggcat.spad.pamphlet
+++ b/src/algebra/aggcat.spad.pamphlet
@@ -753,7 +753,7 @@ FiniteSetAggregate(S:SetCategory): Category ==
complement s == difference(universe(), s )
size() == 2 ** size()$S
index i == {index(j::PositiveInteger)$S for j in 1..size()$S | bit?(i-1,j-1)}
- random() == index((random()$Integer rem (size()$% + 1))::PositiveInteger)
+ random() == index((1 + random(size()$%)$Integer)::PositiveInteger)
lookup s ==
n:PositiveInteger := 1