Java Integer Divide division(int i_Divisor, int i_Dividend)

Here you can find the source of division(int i_Divisor, int i_Dividend)

Description

division

License

Open Source License

Declaration

public final static double division(int i_Divisor, int i_Dividend) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {

    public final static double division(short i_Divisor, short i_Dividend) {
        if (i_Dividend != 0) {
            return ((double) i_Divisor) / ((double) i_Dividend);
        } else {/* w  w w.ja  va 2 s.co  m*/
            return 0;
        }
    }

    public final static double division(Short i_Divisor, Short i_Dividend) {
        if (i_Divisor != null && i_Dividend != null && i_Dividend.shortValue() != 0) {
            return i_Divisor.doubleValue() / i_Dividend.doubleValue();
        } else {
            return 0;
        }
    }

    public final static double division(int i_Divisor, int i_Dividend) {
        if (i_Dividend != 0) {
            return ((double) i_Divisor) / ((double) i_Dividend);
        } else {
            return 0;
        }
    }

    public final static double division(Integer i_Divisor, Integer i_Dividend) {
        if (i_Divisor != null && i_Dividend != null && i_Dividend.intValue() != 0) {
            return i_Divisor.doubleValue() / i_Dividend.doubleValue();
        } else {
            return 0;
        }
    }

    public final static double division(long i_Divisor, long i_Dividend) {
        if (i_Dividend != 0) {
            return ((double) i_Divisor) / ((double) i_Dividend);
        } else {
            return 0;
        }
    }

    public final static double division(Long i_Divisor, Long i_Dividend) {
        if (i_Divisor != null && i_Dividend != null && i_Dividend.longValue() != 0) {
            return i_Divisor.doubleValue() / i_Dividend.doubleValue();
        } else {
            return 0;
        }
    }

    public final static double division(float i_Divisor, float i_Dividend) {
        if (i_Dividend != 0) {
            return ((double) i_Divisor) / ((double) i_Dividend);
        } else {
            return 0;
        }
    }

    public final static double division(Float i_Divisor, Float i_Dividend) {
        if (i_Divisor != null && i_Dividend != null && i_Dividend.floatValue() != 0) {
            return i_Divisor.doubleValue() / i_Dividend.doubleValue();
        } else {
            return 0;
        }
    }

    public final static double division(double i_Divisor, double i_Dividend) {
        if (i_Dividend != 0) {
            return i_Divisor / i_Dividend;
        } else {
            return 0;
        }
    }

    public final static double division(Double i_Divisor, Double i_Dividend) {
        if (i_Divisor != null && i_Dividend != null && i_Dividend.doubleValue() != 0) {
            return i_Divisor.doubleValue() / i_Dividend.doubleValue();
        } else {
            return 0;
        }
    }
}

Related

  1. divideToCeil(int numerator, int denominator)
  2. divideToInt(String address)
  3. divideUnsigned(int dividend, int divisor)
  4. divideWithCeilingRoundingMode(int p, int q)
  5. divideWithoutOverflow(int x, int y)
  6. divisor(int a, int b)
  7. divisor(int m, int n)
  8. divisorMod(int a, int n)
  9. divRoundUp(int a, int b)