James Humes wrote: >I would use the fact that e^x = SUM(n = 0, inf, [(x^n)/n!]). ie.. e^x = >1+x+(x^2/2!)+(x^3/3!)+(x^4/4!)+--- > Now just use -at for x and iterate that sum to desired precision. Then with >a negative exponent, the error would be between 0 and abs(x)^(n+1) /(n+1)!. >So, the more precise you need it, the larger you make n. Using fixed point >for the fractions here is no problem. > That can be implemented in a simple for loop and could be written to avoid >all the multiplies. Lots of times it only takes a few iterations to be >somewhat close. If you're not familiar with summations, I could pseudo code >it. > James > > > What he said. Seriously, I was just going to write about the same thing. -- Martin Klingensmith http://wwia.org/ http://nnytech.net/ -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist