New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
random.expovariate(0.0) #49119
Comments
random.expovariate(lambd) should handle lambd=0 cleanly, and probably At the moment it gives: ZeroDivisionError: float division |
An exponential distribution with parameter 0 isn't an exponential distribution any more. On the real line, there isn't Is there really any use for having expovariate degenerate this way? The proposed change would also not be in keeping with the philosophy |
I would suggest adding a note to the documentation stating clearly that If a negative parameter is permitted then the last sentence of the """... Returned values range from 0 to positive infinity.""" is inaccurate, since values range from 0 to negative infinity in that |
That's all true - the only thing in favour of my suggestion is that to At least the documentation should state the restrictions on lambda. |
Thanks; that makes sense. If 1./0. returned inf then expovariate would Incidentally, if expovariate had been written to take the mean as its |
Doc fixes in r68378. Closing. |
I concur with Mark. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: