List of utility methods to do Number Multiply
Double | multiply(Double a, Double b) multiply if ((a == null) || (b == null)) { return null; return a * b; |
double | Multiply(double px0, double py0, double px1, double py1, double px2, double py2) Multiply return ((px1 - px0) * (py2 - py0) - (px2 - px0) * (py1 - py0));
|
long | multiply(final long a, final long b) multiply final long product = a * b; final long b2 = product / a; if (b2 != b) { throw new ArithmeticException("long overflows: " + a + " * " + b + " = " + product); return product; |
long | multiply(final long x, final long y) multiply if (x < y) { return (long) (x * (y / CORRECTION_FACTOR)); return (long) (y * (x / CORRECTION_FACTOR)); |
int | multiply(int a, int b) multiply int ar = getRed(a); int ag = getGreen(a); int ab = getBlue(a); ar *= getRed(b); ag *= getGreen(b); ab *= getBlue(b); return getRGB(clamp(ar), clamp(ag), clamp(ab)); |
int | multiply(int x, int y) multiply return x * y;
|
Number | multiply(Number a, Number b) Multiplies two numbers, returning the resulting Number. if (a instanceof Integer && b instanceof Integer) { return Integer.valueOf(a.intValue() * b.intValue()); return Double.valueOf(a.doubleValue() * b.doubleValue()); |
T | multiply(Number a, Number b, Class multiply return convert(a.doubleValue() * b.doubleValue(), cl);
|
Number | multiply(Number n1, Number n2) Multiply two numbers Class<?> type = getComputationType(n1, n2); Number val1 = convertTo(n1, type); Number val2 = convertTo(n2, type); if (type == Long.class) return Long.valueOf(val1.longValue() * val2.longValue()); return new Double(val1.doubleValue() * val2.doubleValue()); |
Number | multiply(Number n1, Number n2) multiply if (n1 instanceof Double || n2 instanceof Double) { return n1.doubleValue() * n2.doubleValue(); } else if (n1 instanceof Float || n2 instanceof Float) { return n1.floatValue() * n2.floatValue(); } else if (n1 instanceof Long || n2 instanceof Long) { return n1.longValue() * n2.longValue(); } else { return n1.intValue() * n2.intValue(); ... |