I just wrote: > > [Quoting Doug Manzer:] > > One thing I would try here is to multiply a & b by 1000 so that > > the result Y would ends up 1000 times its actual value y. If the > > smallest non-zero displayable value y = 0.001 then Y = 1; for the > > largest y = 9999, Y = 9,999,000 which is expressable with 24 bits; > > this would require the 32-bit f/p library. AN575 does have a > > conversion for f/p to integer which I could then convert to BCD > > fairly easily. A range check would determine where the decimal > > point belonged. However, if there's an easier way to do this I'd > > appreciate hearing about it -- surely this must be a common > > application for the PIC. > > If those user-settable constants are entered via the 4-digit LCD > display, I would dump the floating-point routines completely and > do all the calculations with integer math, adjusting the decimal > point as needed. This sounds pretty much like what you're > suggesting. Doug: I should have elaborated a little: I would NOT multiply "a" and "b" by 1000 before performing the calculations; I'd simply ignore the decimal points and treat "a" and "b" as integers in the range [1-9999] ("x", of course, would remain an integer in the range [0-255]). After performing the (now greatly-simplified) multiplication and addition, I'd set "y"'s decimal point based on the original decimal-point positions of "a" and "b". -Andy Andrew Warren - fastfwd@ix.netcom.com Fast Forward Engineering, Vista, California http://www.geocities.com/SiliconValley/2499