|
Posted by Tim Martin on 04/21/06 12:52
milahu wrote:
> Heh, nice solution! :)
>
> The 1st statement checks, if $num is a number.
>
> The 2nd one checks, if the the binary "one" is set, as it is with every
> odd number.
> Alternatively, you could use modulo:
> !($num % 2)
>
> IMO, the most odd thing about this is the single "&" between the two
> statements; I would use "&&" or "and" here. ;)
Why would you do that? '&&' and '&' are completely different operators,
and give different results when evaluated in boolean context on two numbers.
Tim
Navigation:
[Reply to this message]
|