feat: nextBool에서 0.5인 경우 엔트로피 절약
This commit is contained in:
@@ -32,6 +32,9 @@ export class RandUtil {
|
||||
if (prob >= 1) {
|
||||
return true;
|
||||
}
|
||||
if (prob === 0.5){
|
||||
return this.nextBit();
|
||||
}
|
||||
return this.nextFloat1() < prob;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,9 @@ 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