commit | f5ea83f4864232fecc042ff0d1c2401807b19280 | [log] [tgz] |
---|---|---|
author | Raymond Hettinger <rhettinger@users.noreply.github.com> | Mon Sep 04 16:51:06 2017 -0700 |
committer | GitHub <noreply@github.com> | Mon Sep 04 16:51:06 2017 -0700 |
tree | 4d5d2e606a94afb4f18cf56a6cc40cb8f9c947d0 | |
parent | 8adc73c2c1a5e3e3c9289dd61ab553b718211b23 [diff] |
random_triangular: sqrt() is more accurate than **0.5 (#3317)
diff --git a/Lib/random.py b/Lib/random.py index e1c2c2b..01c0c3d 100644 --- a/Lib/random.py +++ b/Lib/random.py
@@ -388,7 +388,7 @@ u = 1.0 - u c = 1.0 - c low, high = high, low - return low + (high - low) * (u * c) ** 0.5 + return low + (high - low) * _sqrt(u * c) ## -------------------- normal distribution --------------------