Java Integer Mod modulus(int a, int b)

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

Description

modulus

License

MIT License

Declaration

public static int modulus(int a, int b) 

Method Source Code

//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;
    }
}

Related

  1. modulo(int x, int mod)
  2. modulo(int x, int y)
  3. moduloPositive(final int value, final int size)
  4. moduloPowerOfTwo(final int x, final int powerOfTwoY)
  5. modulus(int a, int b)
  6. modulus(int value, int truncate, boolean flag)
  7. modulus(int[] array)