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)
| 2354 | |
| 2355 | |
| 2356 | def _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 | |
| 2367 | def _decade_less(x, base): |
no test coverage detected
searching dependent graphs…