Java Utililty Methods Long Number Divide

List of utility methods to do Long Number Divide

Description

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

Method

longdivideLongBy1000(long l)
divide Long By
long mem = 0;
mem = l / 1000;
return mem;
LongdivideLongs(Long a, Long b)
divide Longs
return new Long(a.longValue() / b.longValue());
longdivideZero(final long dividend, final long divisor, final long defaultDivisor)
Divides a divident by divisor , with a default value if the divisor is zero.
if (divisor == 0) {
    return dividend / defaultDivisor;
return dividend / divisor;
longdivWithRound(long p, long q)
div With Round
long div = p / q;
long floor;
long ceil;
if (p >= 0) {
    floor = q * div;
    ceil = floor + q;
    return (ceil - p >= p - floor) ? div : div + 1;
} else {
...