feat: RandUtil nextBool false 엔트로피 절약

This commit is contained in:
2022-05-17 23:10:52 +09:00
parent 8595f96a86
commit 9efe7ba171
2 changed files with 7 additions and 1 deletions
+3
View File
@@ -35,6 +35,9 @@ export class RandUtil {
if (prob === 0.5){
return this.nextBit();
}
if (prob <= 0){
return false;
}
return this.nextFloat1() < prob;
}