Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/python/cpython
/ ndigits
Function
ndigits
Modules/_decimal/tests/randdec.py:127–129 ·
view source on GitHub ↗
(n)
Source
from the content-addressed store, hash-verified
125
126
127
def
ndigits(n):
128
if
n < 1:
return
0
129
return
randrange(10**(n-1), 10**n)
130
131
def
randtuple(maxprec, maxexp):
132
n = randrange(100)
Callers
6
randtuple
Function · 0.85
un_incr_digits
Function · 0.85
un_incr_digits_tuple
Function · 0.85
bin_incr_digits
Function · 0.85
tern_incr_digits
Function · 0.85
randint
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected
Used in the wild
real call sites across dependent graphs
searching dependent graphs…