fastmath.c 189 Bytes
Newer Older
Jake Read's avatar
Jake Read committed
1 2 3 4 5 6 7 8 9 10 11
/*
 * fastmath.c
 *
 * Created: 6/20/2018 12:38:38 PM
 *  Author: Jake
 */ 

int fastModulo(int dividend, int divisor){
	// divisor must be a power of 2!
	return dividend & (divisor - 1);
}