We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,
I experienced a problem with uint32 calculations.
The following code calculates a wrong result. Has anyone found other problems with the unsigned long integer data type?
xdata unsigned int test1 = 66; xdata unsigned int test2 = 1000; xdata unsigned long int result; int main () { result=(unsigned long int)test1*(unsigned long int)test2; // result is 464 instead of 66000 // it seems that the compiler does the calculation // with 16 bit operations }
The same code works correct when using signed long int.
You gave me hope for my next release.
I wasn't able to try using the latest version of c51. Till now I have optimised code and reduced max numbers to fit 16 bits.
cheers