Article View: comp.lang.c
Article #1227Re: does an expression in a logical statement need parenthesis for proper evaluation?
From: Keith Thompson
Date: Fri, 06 Nov 2026 22:23
Date: Fri, 06 Nov 2026 22:23
20 lines
2024 bytes
2024 bytes
Lynn McGuire <lynnmcguire5@gmail.com> writes:
> On 11/6/2026 12:50 PM, Keith Thompson wrote:
[...]
>> If this were my project, as long as I'm having to do substantial
>> manual cleanup, I'd probably change it to:
>> if (j1 * i1) < 1)...
>
> Huh? I am confused. Aren't you missing a left parenthesis there?
Yes, that was just a typo. I meant:
if (j1 * i1 < 1)
My point is that *for me*, the fact that "*" binds more tightly than
"<" is so obvious that I find extra parentheses mildly distracting.
Of course both forms are obviously correct.
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
Technical Details
Message-ID:
<11clk1i$2u2oj$1@kst.eternal-september.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!kst.eternal-september.org!.POSTED!not-for-mailReferences:
<11cj4a0$23796$1@dont-email.me> <11cj994$24m06$1@dont-email.me> <11ck0pr$2amtc$1@dont-email.me> <11cl7i3$2pbh3$1@kst.eternal-september.org> <11clgrd$2tiij$2@dont-email.me>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!kst.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson <Keith.S.Thompson+u@gmail.com> Newsgroups: comp.lang.c++,comp.lang.c Subject: Re: does an expression in a logical statement need parenthesis for proper evaluation? Date: Fri, 06 Nov 2026 14:23:44 -0800 Organization: None to speak of Lines: 20 Message-ID: <11clk1i$2u2oj$1@kst.eternal-september.org> References: <11cj4a0$23796$1@dont-email.me> <11cj994$24m06$1@dont-email.me> <11ck0pr$2amtc$1@dont-email.me> <11cl7i3$2pbh3$1@kst.eternal-september.org> <11clgrd$2tiij$2@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Fri, 06 Nov 2026 22:23:47 +0000 (UTC) Injection-Info: kst.eternal-september.org; logging-data="3083027"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/1hYbLaSnxpujgDbVfkTzu"; posting-host="470bea5a7c525a052be348861b0f0884" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:0+ZrXeydEiJ8zNlndc3wzqHw2RM= sha256:zGfh2aXOgTbKJYpQQVp+Gzu2AxUWBshOFL8lrUxx6Hs= sha1:XsexPUdRwJyrmz12FZgaKLyi2Sk= sha256:P0RBf1iZaKEI59/RnObOgH2655RDf6kqCC0jthF5ZBo=