Java Utililty Methods Number Multiply

List of utility methods to do Number Multiply

Description

The list of methods to do Number Multiply are organized into topic(s).

Method

Doublemultiply(Double a, Double b)
multiply
if ((a == null) || (b == null)) {
    return null;
return a * b;
doubleMultiply(double px0, double py0, double px1, double py1, double px2, double py2)
Multiply
return ((px1 - px0) * (py2 - py0) - (px2 - px0) * (py1 - py0));
longmultiply(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;
longmultiply(final long x, final long y)
multiply
if (x < y) {
    return (long) (x * (y / CORRECTION_FACTOR));
return (long) (y * (x / CORRECTION_FACTOR));
intmultiply(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));
intmultiply(int x, int y)
multiply
return x * y;
Numbermultiply(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());
Tmultiply(Number a, Number b, Class cl)
multiply
return convert(a.doubleValue() * b.doubleValue(), cl);
Numbermultiply(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());
Numbermultiply(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();
...