Java Integer Mod mod4(int a)

Here you can find the source of mod4(int a)

Description

Positive modulo 4

License

Open Source License

Parameter

Parameter Description
a a parameter

Declaration

public static int mod4(int a) 

Method Source Code

//package com.java2s;

public class Main {
    /**//from w  ww  . jav a  2s .com
     * Positive modulo 4
     * @param a
     * @return 
     */
    public static int mod4(int a) {
        int c = a % 4;
        return c < 0 ? c + 4 : c;
    }
}

Related

  1. mod(int x, int y)
  2. mod(int x, int y)
  3. mod(int x, int y)
  4. mod(int[]... vectors)
  5. mod(long l, int m)
  6. mod_diff(int x, int y, int R)
  7. modByPowerOfTwo(int value, int mod)
  8. modCeil(int x, int mod)
  9. mode(final StringBuilder buffer, final int mode)