MCPcopy Index your code
hub / github.com/python/cpython / randfloat

Function randfloat

Modules/_decimal/tests/randdec.py:445–452  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

443 return ndigits(p) * (1,-1)[randrange(2)]
444
445def randfloat():
446 p = randrange(1, 100)
447 s = numeric_value(p, 383)
448 try:
449 f = float(numeric_value(p, 383))
450 except ValueError:
451 f = 0.0
452 return f
453
454def randcomplex():
455 real = randfloat()

Callers 2

test_from_floatFunction · 0.90
randcomplexFunction · 0.85

Calls 1

numeric_valueFunction · 0.85

Tested by 1

test_from_floatFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…