Java Integer Divide div(int a, int b)

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

Description

div

License

MIT License

Declaration

public static int div(int a, int b) 

Method Source Code

//package com.java2s;
// Licensed under the MIT License:

public class Main {
    public static int div(int a, int b) {
        if (b == 0)
            return 0x7fffffff;
        if (a == 0x80000000 && b == -1) {
            return 0x7fffffff;
        }//from  ww  w . j  a va  2 s .  c  o  m
        return a / 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)
  5. divce(long size, long divider, int i)