From: Peter C. <pe...@pe...> - 2006-10-24 23:58:12
|
Using the following (on PIC14): var_u_char_8_b = (unsigned char) (var_int_16 / 8); where: var_u_char_8_b is unsigned char var_int_16 is int var_u_char_8_b always seems to be zero. If I get rid of the /8 bit var_u_char_8_b appears (I assume) to hold the least significant byte of var_int_16. Is there a problem here? Am I missing something? The work round is obvious, right shift by 4 bits, but that is less useful if I want to divide by say 3 or 7. Any thoughts? Pete |