note 34626 added to language.operators.arithmetic
| From: | marsman at rack1 dot php dot net | Date: | Fri, 01 Aug 2003 15:26:19 +0000 |
| Subject: | note 34626 added to language.operators.arithmetic | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-53150@lists.php.net to get a copy of this message | ||
in response to the test of 'michael at hotmail or so dot com':
the solution of function div($a,$b){return ($a-($a % $b))/$b} gives an error with such big numbers
because de modulo operator (%) fails and not the calculation as you are suggesting.
So if you need to use those kind of numbers you also need to write a new modulo operator anyway. In
that case you always want to use the floor method because there simply isn't an alternative.
But luckily I think I'll never have to use numbers like that.
----
Manual Page -- http://www.php.net/manual/en/language.operators.arithmetic.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34626
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34626&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34626&report=yes