note 87500 added to function.fmod
| From: | andreas dot damm at maxmachine dot de | Date: | Sun, 07 Dec 2008 23:25:33 +0000 |
| Subject: | note 87500 added to function.fmod | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-147889@lists.php.net to get a copy of this message | ||
...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).
----
Server IP: 212.124.37.9
Probable Submitter: 85.180.6.47
----
Manual Page -- http://www.php.net/manual/en/function.fmod.php
Edit -- https://master.php.net/note/edit/87500
Del: integrated -- https://master.php.net/note/delete/87500/integrated
Del: useless -- https://master.php.net/note/delete/87500/useless
Del: bad code -- https://master.php.net/note/delete/87500/bad+code
Del: spam -- https://master.php.net/note/delete/87500/spam
Del: non-english -- https://master.php.net/note/delete/87500/non-english
Del: in docs -- https://master.php.net/note/delete/87500/in+docs
Del: other reasons-- https://master.php.net/note/delete/87500
Reject -- https://master.php.net/note/reject/87500
Search -- https://master.php.net/manage/user-notes.php