MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / expovariate

Method expovariate

tools/python-3.11.9-amd64/Lib/random.py:613–628  ·  view source on GitHub ↗

Exponential distribution. lambd is 1.0 divided by the desired mean. It should be nonzero. (The parameter would be called "lambda", but that is a reserved word in Python.) Returned values range from 0 to positive infinity if lambd is positive, and from negativ

(self, lambd)

Source from the content-addressed store, hash-verified

611 return _exp(self.normalvariate(mu, sigma))
612
613 def expovariate(self, lambd):
614 """Exponential distribution.
615
616 lambd is 1.0 divided by the desired mean. It should be
617 nonzero. (The parameter would be called "lambda", but that is
618 a reserved word in Python.) Returned values range from 0 to
619 positive infinity if lambd is positive, and from negative
620 infinity to 0 if lambd is negative.
621
622 """
623 # lambd: rate lambd = 1/mean
624 # ('lambda' is a Python reserved word)
625
626 # we use 1-random() instead of random() to preclude the
627 # possibility of taking the log of zero.
628 return -_log(1.0 - self.random()) / lambd
629
630 def vonmisesvariate(self, mu, kappa):
631 """Circular data distribution.

Callers

nothing calls this directly

Calls 1

randomMethod · 0.80

Tested by

no test coverage detected