[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Behavior of logical operators
- From: Reuben Thomas <rrt@...>
- Date: Mon, 14 Mar 2011 11:17:18 +0000
On 14 March 2011 11:14, David Kastrup <firstname.lastname@example.org> wrote:
> Axel Kittenberger <email@example.com> writes:
>>> In C/C++ I would write !!condition. In Lua "not not condition" ?
>> I'm not sure how the ! operation is exactly defined in C(++)
You could try just reading the standards; speculation here is worse
than futile, as it only encourages foolishness.
[#5] The result of the logical negation operator ! is 0 if
the value of its operand compares unequal to 0, 1 if the
value of its operand compares equal to 0. The result has
type int. The expression !E is equivalent to (0==E).