From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7a2d45f282a1da1c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-08-15 09:56:27 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!wn14feed!wn13feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!sccrnsc03.POSTED!not-for-mail Message-ID: <3F3D10B7.9080707@attbi.com> From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: float with 24-bit resolution References: <3F3CCB0F.543478AF@adrianhoe.nospam.com.my> <3f3cd7f4$1_2@news.tm.net.my> <3F3CE28D.B841A191@raytheon.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 66.31.71.243 X-Complaints-To: abuse@comcast.net X-Trace: sccrnsc03 1060966586 66.31.71.243 (Fri, 15 Aug 2003 16:56:26 GMT) NNTP-Posting-Date: Fri, 15 Aug 2003 16:56:26 GMT Organization: Comcast Online Date: Fri, 15 Aug 2003 16:56:26 GMT Xref: archiver1.google.com comp.lang.ada:41526 Date: 2003-08-15T16:56:26+00:00 List-Id: Mark Johnson wrote: > For example, on one system I simulated, a ship did not move until > reaching 5 knots because the result of (speed * delta_time) was less > than the LSB of the distance value. We had to use double precision for > location (X, Y) for most calculations and then use the MSB portion for > display on the screen. Hmmm. I've solved the same problem by recalculating the predicted position whenever needed from the last known position and velocity. But that was in a radar application, where I was doing data fusion, so running each location, velocity pair forward made more sense. > Now - having said all of that, are you still interested in fixed point > arithmetic, and if so what is the real problem being solved so we can > suggest a complete answer? I'll ask the same question a different way. Using fixed-point arithmetic correctly is HARD. Are you sure you are interested in the learning experience you will get? In Ada, getting the declarations of fixed point types correct is not hard, and writing the code for a calculation may be very easy. But you will find you need between ten minutes and a day or more to analyze whether the code you wrote does what you want. This has little or nothing to do with Ada, and everything to do with error and bounds analysis for fixed-point arithmetic. It is hard, but it is often worth it. The only two operations that can introduce errors are division and type conversion. If you choose types correctly, you will often find you have no added error from your calculations. (This is why almost all decent accounting packages use fixed-point arithmetic for most operations.) -- "As far as I'm concerned, war always means failure." -- Jacques Chirac, President of France "As far as France is concerned, you're right." -- Rush Limbaugh