Derived from this question : (Java) How does java do modulus calculations with negative numbers?
Anywhere to force PHP to return positive 51?
Looking for a configuration setting to fix, instead hard-guessing
Or other math function like bcmath?
Not entire convinced by that java answer, as it does not take account of negative modulus