Can someone please explain what is going on here?
-1 % 7 = 6 https://www.wolframalpha.com/input/?i=-1%257 ...but
echo (-1 % 7)."\n"; // prints -1 WRONG
echo fmod(-1,7)."\n"; // prints -1 WRONG
I also tried these examples from php.net, all of them return correctly.
echo (5 % 3)."\n"; // prints 2
echo (5 % -3)."\n"; // prints 2
echo (-5 % 3)."\n"; // prints -2
echo (-5 % -3)."\n"; // prints -2
PHP is giving me a result I can't explain for -1%7. It's not overflowing the int but I tried fmod
anyways, but I'm still having my same issue (ie Doesn't look to be this issue: php modulo return wrong result)