List of utility methods to do Number Power
Double[] | PowerOutageDistr() Power Outage Distr return PowerOutageDistr;
|
String | powerString(int power) power String float scaledPower = Math.abs(power); String unit; if (power >= 1000000) { scaledPower /= 1000000; unit = "mE"; } else if (power >= 1000) { scaledPower /= 1000; unit = "kE"; ... |
String | powerString(int power) power String if (power == 1) { return ""; if (power < 0) { return "^(" + power + ")"; return "^" + power; |
int | powerToInteger(String pow) convert power to integer. if (POWER_LOW.equalsIgnoreCase(pow)) { return 1; } else if (POWER_MEDIUM.equalsIgnoreCase(pow)) { return 2; } else if (POWER_HIGH.equalsIgnoreCase(pow)) { return 3; return 0; ... |
String | powerTrim(String s) power Trim return s.replaceAll("^\\W+", "").replaceAll("\\W+$", ""); |
int | powerType(float power) power Type if (power < 400) { return 0; int type = 1; return (type += Float.valueOf((power - 400) / 400).intValue()) > 3 ? 3 : type; |
long | powerX(long a, long b) Cheap, unsafe, long power. long x = 1; while (b > 0) { x *= a; --b; return x; |
long | powExact(long x, int y) Returns value of x raised in power y, throwing an exception if the result overflows a long. if (y >= 0) { long z = 1L; while (true) { if ((y & 1) != 0) z = Math.multiplyExact(z, x); y >>>= 1; if (y == 0) break; ... |
float | powf(float v1, float v2) powf return (float) Math.pow(v1, v2); |
double | powi(double x, int p) Fast loop for computing Math.pow(x, p) for p >= 0 integer. if (p < 0) { return Math.pow(x, p); double ret = 1.; for (; p > 0; p >>= 1) { if ((p & 1) == 1) { ret *= x; x *= x; return ret; |