From: Darren New <dnew@san.rr.com>
Subject: Re: Zeller's Algorithm
Date: Wed, 31 Jul 2002 19:26:42 GMT
Date: 2002-07-31T19:26:42+00:00 [thread overview]
Message-ID: <3D483A0B.46EB2F7C@san.rr.com> (raw)
In-Reply-To: wccvg6v1zj2.fsf@shell01.TheWorld.com
Robert A Duff wrote:
> Doesn't this make the % operator totally useless for negative numbers?
Yes.
> I mean, how do you write code that gets some useful "right" answer,
> if you're doing % on negative numbers?
You fix it manually, just like most other C gaffes. :-)
x = a % 23;
if (x < 0) x += 23;
--
Darren New
San Diego, CA, USA (PST). Cryptokeys on demand.
** http://home.san.rr.com/dnew/DNResume.html **
** http://images.fbrtech.com/dnew/ **
Things to be thankful for, #37:
No sausage was served at the Last Supper.
next prev parent reply other threads:[~2002-07-31 19:26 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 [this message]
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
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