MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _decade_less_equal

Function _decade_less_equal

lib/matplotlib/ticker.py:2345–2353  ·  view source on GitHub ↗

Return the largest integer power of *base* that's less or equal to *x*. If *x* is negative, the exponent will be *greater*.

(x, base)

Source from the content-addressed store, hash-verified

2343
2344
2345def _decade_less_equal(x, base):
2346 """
2347 Return the largest integer power of *base* that's less or equal to *x*.
2348
2349 If *x* is negative, the exponent will be *greater*.
2350 """
2351 return (x if x == 0 else
2352 -_decade_greater_equal(-x, base) if x < 0 else
2353 base ** np.floor(np.log(x) / np.log(base)))
2354
2355
2356def _decade_greater_equal(x, base):

Callers 4

_decade_greater_equalFunction · 0.85
_decade_lessFunction · 0.85
view_limitsMethod · 0.85
view_limitsMethod · 0.85

Calls 1

_decade_greater_equalFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…