From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3b4bed4f74b8ac49 X-Google-Attributes: gid103376,public From: "Dr. Peter E. Obermayer" Subject: Re: GNAT messages and the not operator (pitfall alert!) Date: 1996/10/30 Message-ID: <3277C5F1.3F4E@cci.de>#1/1 X-Deja-AN: 193514889 distribution: world references: <54snn6$8j5@newsbf02.news.aol.com> content-type: text/plain; charset=us-ascii organization: Competence Center Informatik GmbH mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.0 (Win16; I) Date: 1996-10-30T00:00:00+00:00 List-Id: John Herro wrote: -- Discussion on parntheses deleted > I'm not saying that the code > > if X**2 + 3.0*X + 2.0 < 100.0 then ... Better (X + 3.0)*X + 2.0 < 100.0 > > should be cluttered with unnecessary parentheses. Everyone knows that > "**" comes before "*" and "/", which come before binary "+" and "-", and > everyone knows that the relational operators have a low precedence. It's > also arguable that "everyone" knows that "and" comes before "or". But I'd > say in almost every other case, unless the order of evaluation is very > obvious, use parentheses! > > Even Ada has some pitfalls. If everyone followed this rule, one of them > would be no problem. > > - John Herro > Software Innovations Technology > http://members.aol.com/AdaTutor > ftp://members.aol.com/AdaTutor Peter E. Obermayer _/_/_/ _/_/_/ _/_/_/ Dr. Peter E. Obermayer _/ _/ _/ Tel.: xx49(5931)805-469 _/ _/ _/ Lohberg 10 Fax: xx49(5931)842-469 _/_/_/ _/_/_/ _/_/_/ D-49716 Meppen e-mail: obermayer@cci.de