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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,287e8ed2b0c0aabf X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-31 15:58:33 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!world!news From: Robert A Duff Subject: Re: Zeller's Algorithm Sender: news@world.std.com (Mr Usenet Himself) Message-ID: Date: Wed, 31 Jul 2002 22:57:27 GMT References: <3D3DED1F.24DE3AC8@lmco.com> <3D46CA0E.BCD17D9C@none.provided> <3D470EEE.811F758D@lmco.com> <719a5d07.0207310251.8f1adef@posting.google.com> <3D483A0B.46EB2F7C@san.rr.com> <1028145549.13341@master.nyc.kbcfp.com> <1028154739.212226@master.nyc.kbcfp.com> NNTP-Posting-Host: shell01.theworld.com Organization: The World Public Access UNIX, Brookline, MA X-Newsreader: Gnus v5.7/Emacs 20.7 Xref: archiver1.google.com comp.lang.ada:27548 Date: 2002-07-31T22:57:27+00:00 List-Id: Hyman Rosen writes: > Robert A Duff wrote: > > to claim it's not a flaw seems wrong. > > I didn't claim it's not a flaw, I just claimed that it wasn't > totally useless. Fair enough. How about, "nigh unto useless"? ;-) That is, we haven't seen any examples that take advantage of the well-defined relationship between % and / without also knowing the rounding behavior. >... In any case, every machine I ever worked on > has used round towards zero, but as you go on to say, when I > use %, I tend to make sure that the arguments are not negative. And I guess it implies that (in practise, for me), Ada's "mod" and "rem", and C's "%" are all equivalent: don't use them on negative numbers. At least, that's true when *writing* code. When *reading* code, I must think to myself, "prove it's nonnnegative, or else go look it up." - Bob