fix(business): 修复 skewedRandom 函数中的数学计算错误
- 更新 skewedRandom 函数中的公式,确保正确计算随机值,提升函数的准确性和可靠性。
This commit is contained in:
@@ -434,7 +434,7 @@ function skewedRandom(min: number, max: number): number {
|
||||
v = 0;
|
||||
while (u === 0) u = Math.random();
|
||||
while (v === 0) v = Math.random();
|
||||
const x = Math.pow(u, 1 / alpha) / Math.pow(u, 1 / alpha) + Math.pow(v, 1 / beta);
|
||||
const x = Math.pow(u, 1 / alpha) / (Math.pow(u, 1 / alpha) + Math.pow(v, 1 / beta));
|
||||
return min + x * (max - min);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user