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

Function tern_close_numbers

Modules/_decimal/tests/randdec.py:287–309  ·  view source on GitHub ↗
(prec, emax, emin, itr)

Source from the content-addressed store, hash-verified

285 yield func(prec, emax, emin), randdec(prec, emax)
286
287def tern_close_numbers(prec, emax, emin, itr):
288 if itr is None:
289 itr = 1000
290 for _ in range(itr):
291 for func1 in close_funcs:
292 for func2 in close_funcs:
293 for func3 in close_funcs:
294 yield (func1(prec, emax, emin), func2(prec, emax, emin),
295 func3(prec, emax, emin))
296 for func in close_funcs:
297 yield (randdec(prec, emax), func(prec, emax, emin),
298 func(prec, emax, emin))
299 yield (func(prec, emax, emin), randdec(prec, emax),
300 func(prec, emax, emin))
301 yield (func(prec, emax, emin), func(prec, emax, emin),
302 randdec(prec, emax))
303 for func in close_funcs:
304 yield (randdec(prec, emax), randdec(prec, emax),
305 func(prec, emax, emin))
306 yield (randdec(prec, emax), func(prec, emax, emin),
307 randdec(prec, emax))
308 yield (func(prec, emax, emin), randdec(prec, emax),
309 randdec(prec, emax))
310
311
312# If itr == None, test all digit lengths up to prec + 30

Callers 1

all_ternaryFunction · 0.85

Calls 5

func1Function · 0.85
func3Function · 0.85
randdecFunction · 0.85
func2Function · 0.50
funcFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…