[issue17149] random.vonmisesvariate() results range is inconsistent for small and not small kappa

2013-02-10 Thread Mark Dickinson
Mark Dickinson added the comment: I suspect that this is simply an error in the original code: the docstring says that mu should be in the range [0, 2*pi), so reducing mu modulo 2*pi makes little sense. I guess the lines at the end of the method were intended to be written: if u3 =

[issue17149] random.vonmisesvariate() results range is inconsistent for small and not small kappa

2013-02-10 Thread Mark Dickinson
Mark Dickinson added the comment: Patch. -- keywords: +patch Added file: http://bugs.python.org/file29026/issue17149.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17149 ___

[issue17149] random.vonmisesvariate() results range is inconsistent for small and not small kappa

2013-02-10 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- stage: - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17149 ___ ___

[issue17149] random.vonmisesvariate() results range is inconsistent for small and not small kappa

2013-02-10 Thread Mark Dickinson
Mark Dickinson added the comment: The message for changeset r6370f1593c72 (which introduced the incorrect code) confirms the intentions. I'll apply this patch shortly. iwasawa:cpython mdickinson$ hg log -v -r6370f1593c72 changeset: 7881:6370f1593c72 branch: legacy-trunk user:

[issue17149] random.vonmisesvariate() results range is inconsistent for small and not small kappa

2013-02-10 Thread Mark Dickinson
Mark Dickinson added the comment: Updated patch (thanks Serhiy for reviewing). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17149 ___ ___

[issue17149] random.vonmisesvariate() results range is inconsistent for small and not small kappa

2013-02-10 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: Added file: http://bugs.python.org/file29027/issue17149_v2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17149 ___

[issue17149] random.vonmisesvariate() results range is inconsistent for small and not small kappa

2013-02-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17149 ___ ___ Python-bugs-list mailing list

[issue17149] random.vonmisesvariate() results range is inconsistent for small and not small kappa

2013-02-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6a3d18cede49 by Mark Dickinson in branch '2.7': Issue #17149: Fix random.vonmisesvariate to always return results in [0, 2*math.pi]. http://hg.python.org/cpython/rev/6a3d18cede49 New changeset 41e97652a9f9 by Mark Dickinson in branch '3.2': Issue

[issue17149] random.vonmisesvariate() results range is inconsistent for small and not small kappa

2013-02-10 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17149 ___

[issue17149] random.vonmisesvariate() results range is inconsistent for small and not small kappa

2013-02-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry, I was wrong. I missed that z is in range -1..1. Original report is invalid, random.vonmisesvariate() always returns a value on the full circle. However there is some inconsistency. For small kappa (= 1e-6) result range is 0 to 2pi, for other kappa it

[issue17149] random.vonmisesvariate() results range is inconsistent for small and not small kappa

2013-02-08 Thread Mark Dickinson
Mark Dickinson added the comment: Agreed that this seems inconsistent. The current normalization for non-small kappa is a little odd: e.g, if mu is small and negative (-0.01, say), then we get a range that goes roughly from pi to 3*pi, when a range from -pi to pi would have made more sense.