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

Function tern_incr_digits

Modules/_decimal/tests/randdec.py:391–406  ·  view source on GitHub ↗
(prec, maxexp, itr)

Source from the content-addressed store, hash-verified

389
390# If itr == None, test all combinations of digit lengths up to prec + 30
391def tern_incr_digits(prec, maxexp, itr):
392 if itr is None:
393 lst1 = range(prec+30)
394 lst2 = range(prec+30)
395 lst3 = range(prec+30)
396 else:
397 lst1 = sample(range(prec+30), itr)
398 lst2 = sample(range(prec+30), itr)
399 lst3 = sample(range(prec+30), itr)
400 for m in lst1:
401 for n in lst2:
402 for p in lst3:
403 x = from_triple(randsign(), ndigits(m), 0)
404 y = from_triple(randsign(), ndigits(n), 0)
405 z = from_triple(randsign(), ndigits(p), 0)
406 yield x, y, z
407
408
409# Tests for the 'logical' functions

Callers 1

all_ternaryFunction · 0.85

Calls 4

sampleFunction · 0.85
from_tripleFunction · 0.85
randsignFunction · 0.85
ndigitsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…