---- START NEW MESSAGE --- Received: from cherry.ease.lsoft.com [209.119.0.109] by dpmail10.doteasy.com with ESMTP (SMTPD32-8.05) id A40C127C003C; Wed, 28 Jan 2004 02:50:52 -0800 Received: from PEAR.EASE.LSOFT.COM (209.119.0.19) by cherry.ease.lsoft.com (LSMTP for Digital Unix v1.1b) with SMTP id <2.00CC0A3E@cherry.ease.lsoft.com>; Wed, 28 Jan 2004 5:50:45 -0500 Received: from MITVMA.MIT.EDU by MITVMA.MIT.EDU (LISTSERV-TCP/IP release 1.8e) with spool id 4944 for PICLIST@MITVMA.MIT.EDU; Wed, 28 Jan 2004 05:50:40 -0500 Received: from MITVMA (NJE origin SMTP@MITVMA) by MITVMA.MIT.EDU (LMail V1.2d/1.8d) with BSMTP id 4636; Wed, 28 Jan 2004 05:50:30 -0500 Received: from *unknown [202.144.168.43] by mitvma.mit.edu (IBM VM SMTP Level 430) via TCP with ESMTP ; Wed, 28 Jan 2004 05:50:30 EST X-Warning: mitvma.mit.edu: Host *unknown claimed to be mail.spiderweb.com.au Received: from dialup-226.138.221.203.acc03-beac-mcy.comindico.com.au (dialup-226.138.221.203.acc03-beac-mcy.comindico.com.au [::ffff:203.221.138.226]) by mail.spiderweb.com.au with esmtp; Wed, 28 Jan 2004 20:39:16 +1000 User-Agent: KMail/1.5.3 References: <200401251600.36357.phil@spiderweb.com.au> <008c01c3e30d$0b5bee40$1308a8c0@Daniel> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <200401281751.53679.phil@spiderweb.com.au> Date: Wed, 28 Jan 2004 17:51:53 +1000 Reply-To: pic microcontroller discussion list Sender: pic microcontroller discussion list From: Phil Subject: Re: [PIC:]Another 16 bit maths question To: PICLIST@MITVMA.MIT.EDU In-Reply-To: <008c01c3e30d$0b5bee40$1308a8c0@Daniel> Precedence: list X-RCPT-TO: Status: U X-UIDL: 371856070 On Sun, 25 Jan 2004 16:32, you wrote: > The best way to do this (in code space, complexity, and running time) is to > use fixed point math (integers) for the entire calculation. Simply use > values ten times what they need to be, and make the correction in your > head. > > This gives: angle = 892 - 2*count > Of course! I seem to be always looking for complex methods and overlook the obvious. -- Regards, Phil. -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics .