Can someone give me a hand understanding how to use the remainder (Modulus) operator properly.
For instance I'm trying to divide 480 by 148. On my calculator I get 3.24.
When I try to use // in something like this I get 36 instead of 24:
the variable Fract_part doesn't have the 24 I was expecting, it contains 36 ...?Code:Num_1 var WORD Num_2 var WORD Int_part var WORD Fract_part var WORD Num_1 = 480 : Num_2 = 148 Int_part = Num_1 / Num_2 Fract_part = Num_1 // Num_2
(BTW; I'm trying to work around floating point math on a 16F micro)





Bookmarks