Hi Gordon, We could express the result of your division like this: y/x = a + b/100 where a is the integer part of result and b/100 is the fractional part. If you use an integer division, then you immediately get a and remainder r: y/x = a + r/x Now, we need to get b. We know by substituting y/x in the first equation that r/x = b/100 From that we express b: b = 100*r/x So, the algorithm would be: 1) divide y by x to get a 2) multiply remainder r by 100 3) divide 100*r by x to get b It should work with the routine you found, if the ranges of numbers are right. Nikolai Wednesday, May 22, 2002, 11:00:07 AM, Gordon Varney wrote: > In a PIC, I need to do the following. > 1041 / 50 = 20.82 > What is the proper method of dividing 1041 by 50, then take the answer (20.82) and separating the number into to file > registers. F_cy = 20 and F_in = 82 > Math in a PIC has always confused me. Please Help. > Gordon Varney > www.iamnee.com > -- > http://www.piclist.com hint: PICList Posts must start with ONE topic: > [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads