Try A*100/B - will have the same end effect to getting a percent - of = course no decimal places. >>> rmcelroy@CSTSURVEY.COM 02/22/02 10:48AM >>> 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 =3D A/B * 100; something like that. I have been getting a zero = for percent everytime. -----Original Message----- From: Dale Botkin [mailto:dale@BOTKIN.ORG]=20 Sent: Friday, February 22, 2002 9:22 AM To: PICLIST@MITVMA.MIT.EDU=20 Subject: Re: [PIC]:MPLAB floating point in C What are you trying to do? Float <--> integer conversion is just a matter of casting, and I haven't seen a C compiler recently that didn't support basic operations (+,-,/,*). Standard C math functions will do a lot... are you using a compiler without floating point support? Dale -- "Curiosity is the very basis of education and if you tell me that curiosity killed the cat, I say only the cat died nobly." - Arnold Edinborough On Fri, 22 Feb 2002, Rich Mcelroy wrote: > Does anyone have math libraries for using floating point variables in c. I > am working on a PIC and I have seen microchip's AN575. That would be = very > useful if the application I was working with was in asm. I have looked all > over for help on doing this in c. Maybe someone here can help. Thanks -- 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=20 -- 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=20 -- 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