Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-lcc!well!itivax!umich!jtr485 From: jtr485@umich.UUCP (Johnathan Tainter) Newsgroups: comp.lang.c Subject: Re: conditional expression evaluati Message-ID: <34@umich.UUCP> Date: Wed, 21-Jan-87 10:54:58 EST Article-I.D.: umich.34 Posted: Wed Jan 21 10:54:58 1987 Date-Received: Fri, 23-Jan-87 21:04:19 EST References: <425@bobkat.UUCP> <102600001@datacube> Organization: EECS, University of Michigan Lines: 15 In article <102600001@datacube>, stephen@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