feat: nextBool에서 0.5인 경우 엔트로피 절약
This commit is contained in:
1 parent
485d696e85
commit
da3fb2c094
2 files changed
+6
No files matched your search
@@ -32,6 +32,9 @@ export class RandUtil {
|
||||
if (prob >= 1) {
|
||||
return true;
|
||||
}
|
||||
if (prob === 0.5){
|
||||
return this.nextBit();
|
||||
}
|
||||
return this.nextFloat1() < prob;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user