[issue41421] Random.paretovariate sometimes raises ZeroDivisionError for small alpha

Tim Peters report at bugs.python.org
Tue Jul 28 19:35:48 EDT 2020


Tim Peters <tim at python.org> added the comment:

I'm inclined to ignore this. No actual user has complained about this, and I doubt any ever will:  it's got to be rare as hen's teeth to use a parameter outside of, say, [0.1, 10.0], in real life. The division error can't happen for those. For "small" alpha, the distribution simply does contain values too large to represent as binary doubles. So the only other defensible thing to do be done in this case is to return math.inf (or raise OverflowError) - but why slow it down for something no actual user cares about?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41421>
_______________________________________


More information about the Python-bugs-list mailing list