From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 25 Jun 93 15:09:30 GMT From: ddciiny!jls@uunet.uu.net (Jonathan Schilling) Subject: Re: Precedence Rules (was Re: Software vendors not using Ada but C) Message-ID: List-Id: In article <20cajmINNqeb@umbc4.umbc.edu> berman@umbc.edu (Mike Berman) writes: > >Also, (I've always wanted to ask this), does anyone really use mod and >rem with negative operands? Probably not. But people do use mod with types that include negative numbers (like INTEGER), and unless the compiler is able to figure out that the operands have non-negative values, a fair amount of code will be generated for mod. This is because the semantics for mod do not match the semantics of most machines' divide and remainder instructions, for negative numbers. Thus, it is a good habit to only use mod with non-negative subtypes, or to avoid mod and use rem (unless you really have negative operands and care about the semantics). -- Jonathan Schilling DDC-I, Inc. uunet!ddciiny!jls