comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Zeller's Algorithm
Date: Wed, 31 Jul 2002 22:57:27 GMT
Date: 2002-07-31T22:57:27+00:00	[thread overview]
Message-ID: <wcc4ref1p60.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 1028154739.212226@master.nyc.kbcfp.com

Hyman Rosen <hyrosen@mail.com> 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



  reply	other threads:[~2002-07-31 22:57 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-23 23:56 Zeller's Algorithm Paul A Storm
2002-07-24  7:59 ` Thomas Wolf
2002-07-24 21:30   ` Paul A Storm
2002-07-29  8:29     ` Thomas Wolf
2002-07-30  4:35       ` Robert Dewar
2002-07-30  8:20         ` Thomas Wolf
2002-07-30 17:17 ` Rick Maffei
2002-07-30 22:10   ` Paul A Storm
2002-07-31 10:51     ` Thomas Wolf
2002-07-31 14:33       ` Frank J. Lhota
2002-07-31 19:13         ` Robert A Duff
2002-07-31 19:26           ` Darren New
2002-07-31 20:01             ` Hyman Rosen
2002-07-31 20:15               ` Frank J. Lhota
2002-07-31 21:08               ` Robert A Duff
2002-07-31 22:34                 ` Hyman Rosen
2002-07-31 22:57                   ` Robert A Duff [this message]
2002-08-01 15:17                     ` Hyman Rosen
2002-08-01 16:41                       ` Frank J. Lhota
2002-07-31 21:15               ` Dan Nagle
2002-07-31 22:36                 ` Hyman Rosen
2002-07-31 22:23         ` Matthew Woodcraft
2002-08-02  7:21         ` Thomas Wolf
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox