The easy answer: use a floating point operation in C! (this is cheating I know) float result; int16 num1 = 1041; int8 num2 = 50; result = (float)num1 / num2; -- Lawrence, whose life is too busy not to cheat and use the easy answer once in a while ----- Original Message ----- From: "Gordon Varney" To: Sent: Wednesday, May 22, 2002 1:00 PM Subject: [PIC]:How do I? Math in a pic > 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