Skip to content

Commit

Permalink
Add assert to the RuntimeAssistedMutator RNG
Browse files Browse the repository at this point in the history
  • Loading branch information
carl-smith committed Oct 17, 2023
1 parent 7ccd3e8 commit 79c7778
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ struct JavaScriptRuntimeAssistedMutatorLifting {
}
randomInt() {
this.x = (this.x * this.a + this.c) % this.m;
if (!isInteger(this.x)) throw "RNG state is not an Integer!"
return this.x;
}
randomFloat() {
Expand All @@ -86,7 +87,6 @@ struct JavaScriptRuntimeAssistedMutatorLifting {
probability(p) {
return this.randomFloat() < p;
}
reseed(seed) {
this.x = seed;
}
Expand Down

0 comments on commit 79c7778

Please sign in to comment.