Java Integer Divide divRoundUp(int a, int b)

Here you can find the source of divRoundUp(int a, int b)

Description

div Round Up

License

Open Source License

Declaration

public static final int divRoundUp(int a, int b) 

Method Source Code

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

public class Main {
    public static final int divRoundUp(int a, int b) {
        if (b > a) {
            return 1;
        }/* w w  w  .  j  av a2 s .  com*/
        int result = a % b;
        return result == 0 ? a / b : (a - result) / b + 1;
    }
}

Related

  1. divideWithoutOverflow(int x, int y)
  2. division(int i_Divisor, int i_Dividend)
  3. divisor(int a, int b)
  4. divisor(int m, int n)
  5. divisorMod(int a, int n)
  6. divUp(int dividend, int divisor)