MCPcopy Create free account
hub / github.com/numpy/numpy / power_of_ten

Function power_of_ten

numpy/core/src/multiarray/calculation.c:22–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20#include "array_assign.h"
21
22static double
23power_of_ten(int n)
24{
25 static const double p10[] = {1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8};
26 double ret;
27 if (n < 9) {
28 ret = p10[n];
29 }
30 else {
31 ret = 1e9;
32 while (n-- > 9) {
33 ret *= 10.;
34 }
35 }
36 return ret;
37}
38
39NPY_NO_EXPORT PyObject *
40_PyArray_ArgMinMaxCommon(PyArrayObject *op,

Callers 1

PyArray_RoundFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected