note 87500 deleted from function.fmod by danbrown
| From: | danbrown@php.net | Date: | Mon, 08 Dec 2008 00:52:06 +0000 |
| Subject: | note 87500 deleted from function.fmod by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-147894@lists.php.net to get a copy of this message | ||
Note Submitter: andreas dot damm at maxmachine dot de
----
...or use this:
function modulo($n,$b) {
return $n-$b*(int)($n/$b);
}
It also appears to work correctly, but "(int)" instead of "floor()" is about 20%
faster (tested with PHP5.2.5 cli).