note 34626 deleted from language.operators.arithmetic by sniper

From: Date: Mon, 13 Oct 2003 00:08:57 +0000
Subject: note 34626 deleted from language.operators.arithmetic by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-58393@lists.php.net to get a copy of this message
Note Submitter: marsman at stack dot nl ---- 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.

« previous php.notes (#58393) next »