News for hackers. Stuff that matters.
Re:Counting set bits in an interesting way by jandrewrogers on Saturday April 30, 2022 @04:20PM (#31218931)
These are not guaranteed to be equivalent expressions even for integer types. It improperly conflates boolean casts (the first case) and boolean comparisons (the second case). In languages like C++ this is an important and commonly used semantic distinction that enables cleaner abstractions because the latter case is making assumptions about the type implementation.

Both styles are used but they have distinct meanings in context.

There are no comments on this comment yet.