From: Ryan Bello <ryan_bello@ya...>  20040728 07:31:44

I've had difficulties with the floating point library as well. Besides its enormous size, I've noticed incorrect results when tested with random numbers (using a PC as reference). I've cobbled together a limited (nonoptimized) floating point library in assembly. I tried to make it correct and reasonably small. It takes less than 1K of code and works only on the mcs51 in small model. It has a limited notion of infinity to avoid overflow randomness. It overrides the default __fsadd() __fssub() __fsmul() and various type conversion routines such as __uchar2fs(). It does not have __fsdiv() support. The transcendental functions (sin cos sqrt etc) are not implemented. These functions do a lot of adding and multiplying though, so using this library may help a bit. The overall size would probably still be large enough to exclude small model, in which case this is of no help. (Well maybe not  I don't know about other models) I may also be doing some nonstandard stuff with regards to rounding. I round the LSB up if the nextlower bit is 1 (instead of truncating). This happens even when converting a float to a long, so { long x = __fstoslong (2.5); } would set x to 3; Ryan __________________________________ Do you Yahoo!? Yahoo! Mail  50x more storage than other providers! http://promotions.yahoo.com/new_mail 