Hi,
Is there a possibiliy to improve division or Modulo operations in the
following,
tmp1 = 123;
tmp2 = 123;
frame[8] = ((char)((tmp1/100)+48)); // Division
tmp1 = (tmp2 % 100); // Mod
frame[9] = ((char)((tmp1/10)+48));
tmp1 = (tmp2 % 10);
tmp 1& 2 are unsigned int and frame is a char array.
This is in a 16bit environment. I cant use any math libraries. Is there a
possibility of shifting or subtration methods..?
Thanks in advance.
Densil
Is there a possibiliy to improve division or Modulo operations in the
following,
tmp1 = 123;
tmp2 = 123;
frame[8] = ((char)((tmp1/100)+48)); // Division
tmp1 = (tmp2 % 100); // Mod
frame[9] = ((char)((tmp1/10)+48));
tmp1 = (tmp2 % 10);
tmp 1& 2 are unsigned int and frame is a char array.
This is in a 16bit environment. I cant use any math libraries. Is there a
possibility of shifting or subtration methods..?
Thanks in advance.
Densil
Comment