Java Utililty Methods Number Minus

List of utility methods to do Number Minus

Description

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

Method

intminus(boolean a, boolean b)
minus
int aa = a ? 1 : 0;
int bb = b ? 1 : 0;
return aa - bb;
double[]minus(double a[], double b)
Creates a new vector by subtracting the given real number from the given vector.
double[] c = new double[a.length];
for (int i = 0; i < c.length; i++) {
    c[i] = a[i] - b;
return c;
double[]minus(double[] a)
minus
final double[] r = new double[a.length];
for (int i = 0; i < a.length; ++i) {
    r[i] = -a[i];
return r;
double[]minus(double[] p, double[] q)
minus
return new double[] { p[0] - q[0], p[1] - q[1], p[2] - q[2] };
voidminus(double[][] x, double[][] y, double[][] r)
minus
for (int i = 0; i < x.length; i++) {
    for (int j = 0; j < x[i].length; j++) {
        r[i][j] = x[i][j] - y[i][j];
intminus(int flags, int set)
minus
return flags & ~set;
Integerminus(Integer a, Integer b)
minus
return new Integer(a.intValue() - b.intValue());
Numberminus(Number n)
Negate a number
Number value = normalize(n);
Class<?> type = value.getClass();
if (type == Long.class)
    return Long.valueOf(-n.longValue());
return new Double(-n.doubleValue());
Numberminus(Number n)
Returns The negation of a number, regardless of its type.
if (n instanceof Long)
    return new Long(-n.longValue());
if (n instanceof Integer)
    return new Integer(-n.intValue());
if (n instanceof Short)
    return new Short((short) -n.shortValue());
if (n instanceof Byte)
    return new Byte((byte) -n.byteValue());
...
Stringminus(String bigger, String smaller)
Minus operator
if (bigger.length() > smaller.length()) {
    return bigger.replace(smaller, "");
} else
    throw new IllegalArgumentException("");