commit | 9aaeb5e0c8b5946b305590eb85312c282a457098 | [log] [tgz] |
---|---|---|
author | Mark Dickinson <dickinsm@gmail.com> | Sun Feb 10 14:13:40 2013 +0000 |
committer | Mark Dickinson <dickinsm@gmail.com> | Sun Feb 10 14:13:40 2013 +0000 |
tree | 9d28f5d2ab197b561c907d1fafdf5e36bb174071 | |
parent | f898038ca06f50fd328e0cd0eb5e5b9383b90680 [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 36b9565..bfa710b 100644 --- a/Lib/random.py +++ b/Lib/random.py
@@ -475,9 +475,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