Java Integer Mod modByPowerOfTwo(int value, int mod)

Here you can find the source of modByPowerOfTwo(int value, int mod)

Description

mod By Power Of Two

License

Apache License

Declaration

public static int modByPowerOfTwo(int value, int mod) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {

    public static int modByPowerOfTwo(int value, int mod) {
        return value & mod - 1;
    }/*from   w  w  w.j av a2 s  .  c om*/
}

Related

  1. mod(int x, int y)
  2. mod(int[]... vectors)
  3. mod(long l, int m)
  4. mod4(int a)
  5. mod_diff(int x, int y, int R)
  6. modCeil(int x, int mod)
  7. mode(final StringBuilder buffer, final int mode)
  8. ModEuclidean(int D, int d)
  9. modifyAlpha(int color, int alpha)