diff options
author | Gabriel Dos Reis <gdr@axiomatics.org> | 2015-12-31 14:56:12 -0800 |
---|---|---|
committer | Gabriel Dos Reis <gdr@axiomatics.org> | 2015-12-31 14:56:12 -0800 |
commit | f51aee83708673ef9941174951bec9aee80cb03c (patch) | |
tree | 4d8cfccd653dfa09819234bc61a8775091e4f1e6 /src/algebra/aggcat.spad.pamphlet | |
parent | 039d244dbef31e4ca6d34d2cf42b58b41a572884 (diff) | |
download | open-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.pamphlet | 2 |
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 |