I think the definitive answer was received from MetroWerks.
For the C/C++ compiler we're using, the following logic will give
the wrong answer
long ans = 24 * 24 * 60;
but the following logic will give the right answer
long ans = 24L * 24L * 60L;
(In fact only one of the constants actually needs the 'L')
Roger Stringer
Marietta Systems, Inc.
----------------------------------------------------------------------
>Subject: Multiplication Madness Revisited
>From: "Bradly J. Barton" <[EMAIL PROTECTED]>
>Date: Mon, 28 Feb 2000 16:49:28 -0600
>I didn't see any resolution to this in the last couple digests, so at risk
>of opening a raw wound, I'd like to add my two cents and a piece of sample
>code...
>I first encountered this problem when trying to code something that
>required yesterday's date.. so I decided the best way to do this was to
>take the return value from TimGetSeconds, subtract a day's worth of
>seconds, and feed that result to TimSecondsToDateTime.. the first pass of
>code looked like this:
>DateTimeType dateTime;
>TimSecondsToDateTime((TimGetSeconds() - (60 * 60 * 24)), &dateTime);
>Now, peculiarly enough.. this was not giving me the right answer.. so I
>changed it a little:
>>>>>>>>>>>>>>>
----------------------------------------------------------------------
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html