How to: calculate the modulus (mod or %) of a float in PHP
This little caveat totally stumped me for at least an hour. I was trying to calculate the modulus of a floating point number in PHP.
For those who do not know what the modulus (or mod for short) operator is, it calculates the remainder after doing division. In PHP we use the % operator to calculate modulus.
|
|