commit | be5f91957f3d553a7cbbfdc43f66a3b30bb97aec | [log] [tgz] |
---|---|---|
author | Mark Dickinson <dickinsm@gmail.com> | Sun Feb 10 14:16:10 2013 +0000 |
committer | Mark Dickinson <dickinsm@gmail.com> | Sun Feb 10 14:16:10 2013 +0000 |
tree | 0f6473d649766c9b0dfe61e7d828d8730e0bc46a | |
parent | 497cee456c29202918739275fcc3d1bd0183ae06 [diff] [blame] |
Issue #17149: Fix random.vonmisesvariate to always return results in [0, 2*math.pi].
diff --git a/Lib/random.py b/Lib/random.py index 9b61208..4cbe9ad 100644 --- a/Lib/random.py +++ b/Lib/random.py
@@ -449,9 +449,9 @@ u3 = random() if u3 > 0.5: - theta = (mu % TWOPI) + _acos(f) + theta = (mu + _acos(f)) % TWOPI else: - theta = (mu % TWOPI) - _acos(f) + theta = (mu - _acos(f)) % TWOPI return theta