=20 On Mon, 12 May 2003 08:22:50 -0400, you wrote: >My current program requires the use of a bunch of floating point = variables. >Currently I was using standard 32-bit floating, but have found this = takes up >an enormous amount of program space. >Is there anything else I can do different to save space. For example, = if I >only want to represent numbers ranging from 0 to 9.9 (in 0.1 increments) >etc... Just keep >in mind these 0 to 9.9 numbers need to be used in true 32-bit floating >calculations. > >Any ideas? > >Thanks >D Do you _really_ need floating point ? Couldn't you use fixed point ?=20 remember floating point gives range, not precision - very few things that= embedded apps do require enough range to justify FP.=20 You may need to spend a little time looking at ranges of vars to = determine where to put the fixed point (which may vary for different variables), but you will save a lot = of code/ data space and time.. =46o the case of a range of 0 to 9.9, you could use an unsigned long = with the point between bits 21 and 20, giving a range of 0..15 with 32 bit precision. You may also be = able to use Unsigned ints to give 16 bit precision for some vars, which will also save a lot of space. Depending on how input- and display- oriented things are, another = possibility is to scale everything up by a power of 10 to integers or longs, although using a binary point = is usually a lot more efficient for internal calculations, especially if the binary point is = positioned in a multiple of 8 bits.=20 -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads