Java Integer Divide div(int a, int b)

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

Description

div

License

Apache License

Declaration

public static int div(int a, int b) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static int div(int a, int b) {
        return (a + b / 2) / b;
    }/*w w  w  . j  av  a2 s  . c o  m*/

    public static long div(long a, long b) {
        return (a + b / 2) / b;
    }
}

Related

  1. div(int a, int b)
  2. div(int a, int b)
  3. div(int dividend, int divisor)
  4. div(int val, int coe)