random_triangular: sqrt() is more accurate than **0.5 (#3317)
This commit is contained in:
parent
8adc73c2c1
commit
f5ea83f486
|
@ -388,7 +388,7 @@ class Random(_random.Random):
|
||||||
u = 1.0 - u
|
u = 1.0 - u
|
||||||
c = 1.0 - c
|
c = 1.0 - c
|
||||||
low, high = high, low
|
low, high = high, low
|
||||||
return low + (high - low) * (u * c) ** 0.5
|
return low + (high - low) * _sqrt(u * c)
|
||||||
|
|
||||||
## -------------------- normal distribution --------------------
|
## -------------------- normal distribution --------------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue