Here you can find the source of modulus(int a, int b)
public static int modulus(int a, int b)
//package com.java2s; // Licensed under the MIT License: public class Main { public static int modulus(int a, int b) { if (b == 0) return 0x7fffffff; if (a == 0x80000000 && b == -1) { return 0x7fffffff; }/*www . j av a 2s. c o m*/ return a % b; } }