note 49966 added to language.operators.arithmetic
| From: | sputnik13 at gmail dot com | Date: | Mon, 14 Feb 2005 02:49:06 +0000 |
| Subject: | note 49966 added to language.operators.arithmetic | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-84981@lists.php.net to get a copy of this message | ||
I just had to make a comment about gilthans' use of the bitwise xor operator (^)... I'm
guessing from the line if(($x < 0 ^ $y < 0) && $x != 0) that he wants to verify that
only x or only y is less than 0 AND x != 0... Bitwise operators should not be used for truth values
like this, that's what xor is for.
----
Manual Page -- http://www.php.net/manual/en/language.operators.arithmetic.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+49966
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+49966&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+49966&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+49966&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+49966&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+49966&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+49966&report=yes
Search -- http://master.php.net/manage/user-notes.php