Shame on me :( My brain has ceased to function.
I have a int16_t called result.
I wish to divide result by sixteen. I want 2 decimal places of precision.
The whole number is simple... int x = result / 16.
It's the decimal part thats hurting my head.
int tmp = result - (x * 16) that should give me the fractional part, no?
I'm looking for whole_number, decimal_part. But I'm going around in circles :(
i.e. 363/16 = 22.69 whole_number = 22, decimal part = 69
WTF am I doing wrong (today)... ?
EDIT: forget it. I'm a fool :(