2015-04-19 06:58 AM
How do I assign the variables a1 and a2 x ?
I want to read the typed valueunsigned long x; //readings value
unsigned long a; //value
unsigned int a1; //values written
unsigned int a2; //values written
a=40000000;
a1=a/65536;
a2=a%65536;
//x=a1; //that does not happen
//x=a2; //that does not happen
//x=a1+a2; //that does not happen
2015-04-19 07:40 AM
How would adding one number you just divided by 65536 ever get you back to the original number?
unsigned long x;
x=((unsigned long)a1 << 16)+(unsigned long)a2;
2015-04-19 09:44 AM
Thank you very much
understood