Here you can find the source of modByPowerOfTwo(int value, int mod)
public static int modByPowerOfTwo(int value, int mod)
//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*/ }