----- Original Message ----- From: "Rich Mcelroy" To: Sent: Friday, February 22, 2002 9:48 AM Subject: Re: [PIC]:MPLAB floating point in C > I'm using Bytecraft's compiler for MPLAB. it does basic math, but the > results I'm getting indicate that it is droping anything after the integer > on my calculations. I'm trying to calculate a percentage: > > Percent = A/B * 100; something like that. I have been getting a zero for > percent everytime. Try multiplying A by 100 first and then divide by B. eg. x = (A * 100) / B IOW, eliminate the fractional parts by scaling them to integers before doing the divide. michael brown -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics