List of utility methods to do Number Power
long | pow10(final int exponent) A very efficient function to compute powers of 10. return POWER10[exponent];
|
double | pow10(int degree) Adapted from com.devexperts.dxpro.common.util.MathUtils. double pow; if (degree >= 0) { pow = 1; for (int i = 0; i < degree; i++) { pow *= 10; } else { pow = 0.1; ... |
double | pow10(int n) pow if (n == 0) return 1; else if (n > 0) { double d = 1; for (int i = 0; i < n; i++) d = d * 10.; return d; } else { ... |
float | pow16(float a) pow a = pow4(a);
return pow4(a);
|
double | pow2(double base, double power) pow double result = 1; while (power != 0) { if (power > 0) { --power; result *= base; } else { result /= base; ++power; ... |
double | pow2(double num) pow return num * num;
|
double | pow2(double x, int n) Alternate implementation of the power method. if (x == 0 && n <= 0) throw new IllegalArgumentException("x is zero and n=" + n); else if (n == 0) return 1; else if (n > 0) return x * pow2(x, n - 1); else return 1 / pow2(x, -n); ... |
int | pow2(final int a) pow return a * a;
|
int | pow2(final int n) Return 2^n .
return 1 << n;
|
int | pow2(final int x) Simple 2^x if (x <= 0) { return 1; return 2 << x - 1; |