feat: RandUtil nextBool false 엔트로피 절약

This commit is contained in:
Hide_D committed 2022-05-17 23:10:52 +09:00
1 parent 8595f96a86
commit 9efe7ba171
2 files changed
+7 -1

No files matched your search

+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;
}