note 80386 rejected from function.fmod by nlopess
| From: | nlopess@php.net | Date: | Sun, 13 Jan 2008 14:22:50 +0000 |
| Subject: | note 80386 rejected from function.fmod by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-135073@lists.php.net to get a copy of this message | ||
Note Submitter: klasto at centrum dot cz
----
I have this code for dividing two numbers:
$dividend = "100200300400500";
$divident = "1000";
while ($dividend!="0") {
$divisionRemainder = fmod($dividend, $divident);
$answer = $dividend/$divident;
$integralNumber = (int) $answer;
$dividend = $integralNumber;
};
For my is important know division remainder, because I need cut number 100200300400500...900... ect.
on numbers with 3 number(100, 200, 300, 400... ect.)
My code is good to number 100200300400 and if is number more biger than number 100200300400 (in
size), division number is incorrect.
For 100200300400 is answer 400, 300, 200, 100.
For 100200300400500 is answer 500, 592, 52, 416, 1 ... this are bad numbres ... right is 500, 400,
300, 200, 100.
Where is problem?
Thank you.