[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gawk-5.1.1 bug report

From: Paul Eggert
Subject: Re: gawk-5.1.1 bug report
Date: Wed, 6 Apr 2022 10:02:25 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0

On 4/6/22 01:24, arnold@skeeve.com wrote:
Most people
would wonder "Why is there a bitwise and here?" and not think of it
as a logical and.

I'm not sure I agree about the "most", as I expect most people won't notice or care about this level of detail. However, for people who wonder like that, about adding an explanatory comment? That will help people who are unaccustomed to this valid and useful (albeit less-common) programming style. Something like the attached (untested) patch, perhaps?

& for a logical test can be dangerous since any non-zero
value can be true.

Sure, but that's an issue only when using & on types like 'int'. It's not an issue when using & on 'bool'. Similarly, + has rounding issues on 'float' but that doesn't mean we need to worry about +'s rounding issues on 'int'.

Attachment: dfa.diff
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]