Page 1 of 1

PostPosted: Mon Feb 05, 2001 7:49 pm
by pld
32 bit overflow seems to be incorrectly handled by PocketC for certain calculations.

For example:

0x7fffffff * 0xfffffffe ==> 0xfffffffc (-4)


The correct overflow scenario ought to be:

0x7fffffff * 0xfffffffe ==> 0x00000002 (2)
This can also be verified the hard way by a pen and a piece of paper. Other 32 bit signed calculators does this correctly,
for example WIN95 calcualtor.

PostPosted: Wed Feb 14, 2001 2:24 pm
by awschwab
Another type of overflow can be confusing. If you include too much precision in a floating point constant (eg. fCosF=cos(6.283185307/iN);) it compiles without error messages on both PDE and PocketC on the Palm device. Code compiled on PDE runs fine on POSE and the device, which makes it harder to find the error. Compilation on the Palm device gives output that does not run properly. Solution: If you want to compile on the device, don't check whether you have included too many digits by compiling with PDE.