Re: operating with binary



CBFalconer posted:

You wanted 1U << (CHAR_BIT - 1).

Kindly consult an operator precedence table.

No, Dave is right. The parentheses, whether or not necessary in C,
greatly improve the readability.


Subjective observation. I myself have no problem whatsoever with:

1U << CHAR_BIT-1

Putting in redundant parentheses just adds clutter -- I find it more readable
without them.

--

Frederick Gotham
.



Relevant Pages

  • Re: What are your favorite Ruby features?
    ... If we insist, implicitly or otherwise, that readability ... Parentheses are traditionally used to group things together. ... This has nothing to do with other programming languages, ...
    (comp.lang.ruby)
  • Re: Parentheses usage
    ... >I understand parentheses are used for precedence and such, ... Besides this construction generally improves readability. ...
    (comp.lang.pascal.misc)
  • Re: Parentheses usage
    ... What's the difference between using parentheses around the ... The parentheses are actually redundant but some programmers might find that they help them as far as readability is concerned. ... The usefulness of additional (but otherwise redundant) parentheses becomes more apparent when significantly more complex examples of expressions are being considered. ... Chris Burrows ...
    (comp.lang.pascal.misc)
  • Re: excel SUM function - can it be limited to whats in parentheses?
    ... you put your data in separate fields. ... parentheses in each given line that is being added up? ... cookies ... Dave Peterson ...
    (microsoft.public.excel.misc)
  • Re: sumif, multiple criteria
    ... So is it still missing any brackets or parentheses? ... can't use full-column references, as Dave points out. ...
    (microsoft.public.excel.misc)