At 12:23 PM 8/19/2005 -0400, you wrote: >Of course, this is easily done with fixed point as well. The difference >is people are more careful with fixed point. They consider the range of >numbers, the end cases, and choose a fixed point position base on those >results. > >With FP people tend to think "I can handle ANY range" and end up causing >very bad things to happen. Another thing-it's not hard to get into trouble in real situations using the "small" FP representations (like 24 bits). If you're just doing m*x+b type stuff, then the problem never crops up, but if you're evaluating an ill-conditioned polynomial etc. it's pretty easy to lose enough bits to cause problems with real-world 3-4 decimal digit numbers. This is not "round-off error". Conceptually, what happens is that two almost-equal numbers in a partial result are subtracted, leaving many fewer bits than were there originally. If possible, a better algorithm is one answer, but that's not always convenient (for example, it may consume a LOT more code memory if you substitute many low-order cubic splines for one or two poly fits). The FP math will be at least as good as the fixed-point math if the number of bits *in the mantissa* is at least as many as the bits in the fixed-point numbers. The bits devoted to the exponent are essentially wasted as far as this issue goes, since you handle the scaling manually during programming. Personally, I find myself using FP math more these days in instrumentation and control firmware. Back in the old days, when every byte and every cycle counted, it was most undesirable in most applications, but now it has its place. >Best regards, Spehro Pefhany --"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com ->> Inexpensive test equipment & parts http://search.ebay.com/_W0QQsassZspeff -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist