> > > I think the killers are the floating point numbers I'm using. > > > > Use fixed-point arithmetic: integers that represent a certain > > base value > > (not necessarily 1). more work for you, much less code. > > > > Wouter van Ooijen > > > > > -----Original Message----- > From: Mccauley, Daniel H [SMTP:daniel.h.mccauley@LMCO.COM] > Sent: Tuesday, June 03, 2003 1:52 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: [PIC]: Tips to reduce Program Size using CCS C > > So is that basically like taking a LONG INT (0-62536 or whatever it is) > and > making it: > > 0 to 62.536 > or > 0 to 625.36 etc...???? > > Is that basically all one is doing here??? > > Thanks > Dan > Nearly. You wouldn't normaly have the fixed points as decimal as it brings back a lot of the overhead. Simply assign a fixed number of low order bits for your fractional part and the rest for the integer part. This way all you need to do is to mask and shift in order to obtain fixed and fractional parts. You can then simply use normal integer math functions. Regards Mike ======================================================================= This e-mail is intended for the person it is addressed to only. The information contained in it may be confidential and/or protected by law. If you are not the intended recipient of this message, you must not make any use of this information, or copy or show it to any person. Please contact us immediately to tell us that you have received this e-mail, and return the original to us. Any use, forwarding, printing or copying of this message is strictly prohibited. No part of this message can be considered a request for goods or services. ======================================================================= Any questions about Bookham's E-Mail service should be directed to postmaster@bookham.com. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.