mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-12 23:47:34 +02:00
Fixing typo in random-integer fix.
This commit is contained in:
parent
11cb17835b
commit
7e80510755
1 changed files with 5 additions and 5 deletions
|
@ -69,12 +69,12 @@ static sexp sexp_rs_random_integer (sexp ctx, sexp self, sexp_sint_t n, sexp rs,
|
||||||
}
|
}
|
||||||
/* Scan down, modding bigits > bound to < bound, and stop as */
|
/* Scan down, modding bigits > bound to < bound, and stop as */
|
||||||
/* soon as we are sure the result is within bound. */
|
/* soon as we are sure the result is within bound. */
|
||||||
for (i = hi-1; i >= 0; i++) {
|
for (i = hi-1; i >= 0; i--) {
|
||||||
mod = sexp_bignum_data(bound)[i-1];
|
mod = sexp_bignum_data(bound)[i];
|
||||||
if (mod && sexp_bignum_data(res)[i-1] > mod) {
|
if (mod && sexp_bignum_data(res)[i] > mod) {
|
||||||
sexp_bignum_data(res)[i-1] %= mod;
|
sexp_bignum_data(res)[i] %= mod;
|
||||||
}
|
}
|
||||||
if (sexp_bignum_data(res)[i-1] != mod) {
|
if (sexp_bignum_data(res)[i] != mod) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue