List of utility methods to do Number Power
double | pow(double a, double b) pow double pow = 1; for (int i = 0; i < b; i++) { pow *= a; return pow; |
double | pow(double a, double b) Return a to the power of b, sometimes written as a ** b but not to be confused with the bitwise ^ operator. return ieee754_pow(a, b);
|
double | pow(double a, double b) Computes a relaxed power function. if (a != 0) { return Math.pow(a, b); return 0; |
double | pow(double a, double b) Returns the value of the first argument raised to the power of the second argument. return Math.pow(a, b);
|
double | pow(double a, int b) Computes a^b for integer exponents. if (b < 0.0) { a = 1.0 / a; b *= -1; double result = 1.0; while (b != 0) { if ((b & 1) == 1) { result *= a; ... |
double | pow(double base, double exp) pow return Math.pow(base, exp);
|
double | pow(double base, int exp) pow double result = 1.0; while (exp > 0) { if ((exp & 1) == 1) { result = result * base; exp--; base = base * base; exp /= 2; ... |
double | pow(double base, int exp) pow return exp == 0 ? 1 : sq(pow(base, exp / 2)) * (exp % 2 == 1 ? base : 1);
|
double | pow(double base, int exponent) pow if (exponent == 0) return 1; if (exponent == 1) return base; if (exponent == -1) return 1 / base; boolean negative; if (exponent < 0) { ... |
int | pow(double number) pow if (number < 2) return 2; int i = 1; int result = 0; while (result < number) { result = (int) Math.pow(2, i++); return result; ... |