note 59193 added to language.operators.arithmetic
| From: | ahdai0718 at gmail dot com | Date: | Tue, 29 Nov 2005 08:21:15 +0000 |
| Subject: | note 59193 added to language.operators.arithmetic | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-99277@lists.php.net to get a copy of this message | ||
Find some strange statement above :
$a = (8 - ((9.7 - 9)*10)) % 8;
echo '(8 - ((9.7 - 9)*10)) % 8 = '.$a.'<br>';
$a = (8 - ((9.6 - 9)*10)) % 8;
echo '(8 - ((9.6 - 9)*10)) % 8 = '.$a.'<br>';
$a = (8 - ((9.5 - 9)*10)) % 8;
echo '(8 - ((9.5 - 9)*10)) % 8 = '.$a.'<br>';
$a = (8 - ((9.4 - 9)*10)) % 8;
echo '(8 - ((9.4 - 9)*10)) % 8 = '.$a.'<br>';
$a = (8 - ((9.3 - 9)*10)) % 8;
echo '(8 - ((9.3 - 9)*10)) % 8 = '.$a.'<br>';
$a = (8 - ((9.2 - 9)*10)) % 8;
echo '(8 - ((9.2 - 9)*10)) % 8 = '.$a.'<br>';
$a = (8 - ((9.1 - 9)*10)) % 8;
echo '(8 - ((9.1 - 9)*10)) % 8 = '.$a.'<br>';
OUTPUT:
(8 - ((9.7 - 9)*10)) % 8 = 1
(8 - ((9.6 - 9)*10)) % 8 = 2
(8 - ((9.5 - 9)*10)) % 8 = 3
(8 - ((9.4 - 9)*10)) % 8 = 3
(8 - ((9.3 - 9)*10)) % 8 = 4
(8 - ((9.2 - 9)*10)) % 8 = 6
(8 - ((9.1 - 9)*10)) % 8 = 7
What happen?
i think the output is
1
2
3
4
5
6
7
Somebody could explain this...thx...^^
----
Manual Page -- http://www.php.net/manual/en/language.operators.arithmetic.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+59193
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+59193&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+59193&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+59193&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+59193&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+59193&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+59193&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+59193&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+59193&report=yes
Search -- http://master.php.net/manage/user-notes.php