🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c++
Article #825

Re: does an expression in a logical statement need parenthesis for proper evaluation?

#825
From: Janis Papanagnou
Date: Wed, 11 Nov 2026 07:38
29 lines
2396 bytes
On 2026-11-10 22:23, Chris M. Thomasson wrote:
> On 11/10/2026 8:41 AM, Bonita Montero wrote:
>> Am 10.11.2026 um 09:58 schrieb Fred. Zwarts:
>>> Op 09.nov.2026 om 10:03 schreef Bonita Montero:
>>>> Am 06.11.2026 um 00:42 schrieb Lynn McGuire:
>>>>
>>>>> if (j1 * i1 < 1) {
>>>>>      goto L463;
>>>>> }
>>>>> ...
>>>>> if ((j1 * i1) < 1) {
>>>>>      goto L463;
>>>>> }
>>>> The latter one leads to more optimized code !
>>>
>>> Really? Why?
>>
>> It's faster the more braces you have.
> 
> You mean taking pressure off of the compiler stages, or what?

It's actually depending on the quotient of parenthesis and braces,
just to be clear. If the number of braces is f(i) and the number
of parenthesis is f(i+1), where 'f' is the Fibonacci function,
the compiler will be able to create faster code, whereas if these
numbers are swapped it will create slower code. (Obviously, no?)

Janis
Technical Details
Message-ID: <11d1621$1mq7o$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <11cj4a0$23796$1@dont-email.me> <11cs28o$1395m$1@raubtier-asyl.eternal-september.org> <11cumba$1ppuo$1@dont-email.me> <11cvhg8$2ahke$2@raubtier-asyl.eternal-september.org> <11d0209$2guta$1@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Janis Papanagnou <janis_papanagnou+ng@hotmail.com>
Newsgroups: comp.lang.c++,comp.lang.c
Subject: Re: does an expression in a logical statement need parenthesis for
 proper evaluation?
Date: Wed, 11 Nov 2026 08:38:41 +0100
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <11d1621$1mq7o$1@dont-email.me>
References: <11cj4a0$23796$1@dont-email.me>
 <11cs28o$1395m$1@raubtier-asyl.eternal-september.org>
 <11cumba$1ppuo$1@dont-email.me>
 <11cvhg8$2ahke$2@raubtier-asyl.eternal-september.org>
 <11d0209$2guta$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 11 Nov 2026 07:38:41 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="1796344"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19mV3TE6fhzqqnxTG3TS901"; posting-host="9113698624bd0aa570a9174649a81d0c"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:vILfCQznaL1F89e8bX12RVdZyQw= sha256:eulUpTXPIXOQRMomujbD569y5hhOSKh2oN7wLnTiZCQ=
	sha1:o0x2SK5IxaE7GAr4pwMnZMKLZ2I= sha256:1Bj72F/xHui3R8V4XSkGXYMozutIZ/19Agqk5+bG+1U=
Content-Language: en-US
In-Reply-To: <11d0209$2guta$1@dont-email.me>