Udi Kobi wrote:
Hello,
Using the following code:
double
DayToNum(int d, int h, int p)
{
return p + h * 1080 + d * 1080 * 24;
}
call:
double a = DayToNum(2, 5, 204));
returns an overflow value -8092, instead of 57444
How is it possible?
Another thing:
1080 is the value as 2-byte signed integer, 1080UL tells the compiler to
use it as 4 byte unsigned long, 1080.0 will force the compiler to do the
calculation as float.
Regards
Henk
--
-------------------------------------------------------------------------
Henk Jonas [EMAIL PROTECTED]
Palm OS ® certified developer
Please contact me, if you need an off-side contract worker.
-------------------------------------------------------------------------
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/