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

Stringminus(String second, String first)
minus
try {
    return String.valueOf(Integer.parseInt(first) - Integer.parseInt(second));
} catch (NumberFormatException e) {
    try {
        return String.valueOf(Double.parseDouble(first) - Double.parseDouble(second));
    } catch (NumberFormatException e2) {
        throw new IllegalArgumentException(first + " - " + second);
intminus128(int v)
minus
return (int) (v - 128);
charminuscula(char c)
minuscula
if (c >= 65 && c <= 90) {
    return (char) (c + 32);
} else {
    return c;
charminusculas(char c)
Metodo minusculas: Convierte a minusculas el caracter recibido y luego lo retorna
return Character.toLowerCase(c);
intminusDayOfWeek(int dow, long days)
minus Day Of Week
return plusDayOfWeek(dow, -(days % 7));
voidminusEquals(double[] w, double v)
w[i] = w[i] - v
for (int i = 0; i < w.length; i++) {
    w[i] -= w[i] + v;
voidminusEquals(int[] vals, int min)
minus Equals
for (int i = 0; i < vals.length; i++) {
    vals[i] -= min;
voidminusEqualsInverse(double[] w, double[] v, double a)
v = w - a*v
for (int i = 0; i < w.length; i++) {
    v[i] = w[i] - a * v[i];
intminusExact(final int a, final int b)
minus Exact
final int diff = a - b;
if (((a ^ b) & (a ^ diff)) < 0) {
    throw new ArithmeticException("integer overflow");
return diff;
longminusExact(long a, long b)
minus Exact
if ((a ^ b) >= 0) { 
    return a - b;
} else {
    long diff = a - b;
    if ((a ^ diff) < 0) {
        throw new ArithmeticException("overflow: " + a + "-" + b);
    } else {
        return diff;
...