So here's the problem. I want to take a nice innocent number (41) and raise it to the 6th power, subtract 1, and evaluate it in modulo 5.
So, we have
$temp =(pow(41,6)-1);
$temp%5;
It should return 0, but alas, it returns 3.
So, I found this function, fmodAddOn($x,$y). It makes perfect sense to do the following:
function fmodAddOn($x,$y)
{
$i = floor($x/$y);
// r = x - i y
return $x - $i$y;
}
So we would hope fmodAddOn($temp,5) would return 0, but it returns a decimal number. Here's why: $x/$y is returning a whole number, and the floor function is subtracting one from it.
Does anyone have a solution to this problem?