Here you can find the source of div(int a, int b)
public static int div(int a, int b)
//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; } }