I'm doing a simple bit of maths on a PIC microcontroller, running code in C and using MPLABX and the xc16 compiler. This is the code:
double mydouble = 0.019440;
long long int mypower = 281474976710656;
long long int result = mypower*mydouble;
Printing out 'result' gives me 5,471,873,794,048; while it should give 5,471,873,547,255. Any idea what is causing this problem, and how I can rectify it?
Thanks