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

Function _decade_greater_equal

lib/matplotlib/ticker.py:2356–2364  ·  view source on GitHub ↗

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

(x, base)

Source from the content-addressed store, hash-verified

2354
2355
2356def _decade_greater_equal(x, base):
2357 """
2358 Return the smallest integer power of *base* that's greater or equal to *x*.
2359
2360 If *x* is negative, the exponent will be *smaller*.
2361 """
2362 return (x if x == 0 else
2363 -_decade_less_equal(-x, base) if x < 0 else
2364 base ** np.ceil(np.log(x) / np.log(base)))
2365
2366
2367def _decade_less(x, base):

Callers 4

_decade_less_equalFunction · 0.85
_decade_greaterFunction · 0.85
view_limitsMethod · 0.85
view_limitsMethod · 0.85

Calls 1

_decade_less_equalFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…