Java Long Number Divide divCeil(long a, long b)

Here you can find the source of divCeil(long a, long b)

Description

div Ceil

License

Open Source License

Declaration

public static long divCeil(long a, long b) 

Method Source Code

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

public class Main {
    public static int divCeil(int a, int b) {
        if (b < 0) {
            return divCeil(-a, -b);
        } else if (a >= 0) {
            return ((a + b - 1) / b);
        }/*from w w  w .jav a  2  s. c  om*/
        return a / b;
    }

    public static long divCeil(long a, long b) {
        if (b < 0) {
            return divCeil(-a, -b);
        } else if (a >= 0) {
            return ((a + b - 1) / b);
        }
        return a / b;
    }
}

Related

  1. div(long dividend, long divisor)
  2. div_ceil(long n, long d)
  3. divide(final long dividend, final long divisor)
  4. divide(long dividend, long divisor)
  5. divideAndRoundUp(long x, long y)
  6. divideForMean(long sum, long count)