[issue4869] random.expovariate(0.0)

Mark Dickinson report at bugs.python.org
Wed Jan 7 18:39:59 CET 2009


Mark Dickinson <dickinsm at gmail.com> added the comment:

> to allow lambda=0 is sometimes useful in simulations, meaning that it's
> infinite time to the next event, i.e. it never occurs.

Thanks; that makes sense.  If 1./0. returned inf then expovariate would 
already do what you want.  But rightly or wrongly, Python just doesn't 
work that way.

Incidentally, if expovariate had been written to take the mean as its 
argument (instead of the reciprocal of the mean) then this would be easy:  
just provide a parameter of float('inf') and everything would work.  (And 
a parameter of 0 would give a point distribution at 0, which again seems 
perfectly sound.)

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4869>
_______________________________________


More information about the Python-bugs-list mailing list