MCPcopy Index your code
hub / github.com/RustPython/RustPython / random

Method random

Lib/random.py:897–899  ·  view source on GitHub ↗

Get the next random number in the range 0.0 <= X < 1.0.

(self)

Source from the content-addressed store, hash-verified

895 """
896
897 def random(self):
898 """Get the next random number in the range 0.0 <= X < 1.0."""
899 return (int.from_bytes(_urandom(7)) >> 3) * RECIP_BPF
900
901 def getrandbits(self, k):
902 """getrandbits(k) -> x. Generates an int with k random bits."""

Callers 6

uniformMethod · 0.45
triangularMethod · 0.45
expovariateMethod · 0.45
paretovariateMethod · 0.45
weibullvariateMethod · 0.45
utcoffsetMethod · 0.45

Calls 1

from_bytesMethod · 0.45

Tested by

no test coverage detected