conditional expression evaluati

Johnathan Tainter jtr485 at umich.UUCP
Thu Jan 22 01:54:58 AEST 1987


In article <102600001 at datacube>, stephen at datacube.UUCP writes:
>>     x = (a | b | c);
>> if the variable `a' contains zero, the compiler must still OR the
>> contents of `b' and `c' to determine the result.  These are bitwise
>> logical operators.  Short-circuiting these makes no more sense than
>> short-circuiting a sequence of multiplies as soon as one of the
>> operands evaluates to `1'.
>> Mike McNally                                    Digital Lynx Inc.
> This posting indicates a misunderstanding of how short-circuit evaluation
> works. In the case of the '|' expression above, the decision to not evaluate
> is would occur when a or b are all ones, NOT when a or b was zero.
You mean if the '|' had been a '||', of course.
And actually, when a or b is NONZERO not ALL ONES.
--j.a.tainter
> Stephen Watkins                    UUCP: ihnp4!datacube!stephen



More information about the Comp.lang.c mailing list