Re: !!, what is it?
- From: Kenneth Brody <kenbrody@xxxxxxxxxxx>
- Date: Sun, 11 Sep 2005 21:10:21 -0400
Flash Gordon wrote:
>
> Cafer Å?imÅ?ek wrote:
[...]
> > I think, C standarts says something about logical operations resusts;
> > if the result is false, it's value is 0 (zero). if the result is true,
> > it's value is non-zero (like -2, -1, 2, 3, ...). So, it must NOT be
> > one. This difference has seen according to compiler or target
> > platform.
>
> Incorrect. The result of any logical operator is *always* 0 or 1 and
> this is defined by the standard. What probably has you confused is that
> any non-zero value will act as true, so all the values you quote will
> act as true. However, I repeat, the boolean operators will never return
> any value other than 0 or 1 on *any* implementation.
[...]
Well, any C89 or later, I assume. I've worked on platforms (prior to
1989) where boolean expressions were 0 or -1.
--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody/at\spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Don't e-mail me at: <mailto:ThisIsASpamTrap@xxxxxxxxx>
.
- Follow-Ups:
- Re: !!, what is it?
- From: Charlie Gordon
- Re: !!, what is it?
- References:
- !!, what is it?
- From: bjk of course
- Re: !!, what is it?
- From: Mike Wahler
- Re: !!, what is it?
- From: Cafer Şimşek
- Re: !!, what is it?
- From: Flash Gordon
- !!, what is it?
- Prev by Date: Re: Extracting Digits from a Number
- Next by Date: Re: !!, what is it?
- Previous by thread: Re: !!, what is it?
- Next by thread: Re: !!, what is it?
- Index(es):