From be5f91957f3d553a7cbbfdc43f66a3b30bb97aec Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Sun, 10 Feb 2013 14:16:10 +0000 Subject: Issue #17149: Fix random.vonmisesvariate to always return results in [0, 2*math.pi]. --- Lib/random.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Lib/random.py') diff --git a/Lib/random.py b/Lib/random.py index 9b61208d2e..4cbe9ade43 100644 --- a/Lib/random.py +++ b/Lib/random.py @@ -449,9 +449,9 @@ class Random(_random.Random): 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 -- cgit v1.2.1