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,1dd28d5040ded1f8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-16 06:54:12 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Announce: Grace project site operational Date: 16 May 2002 09:52:49 -0400 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: <3CD88FBD.4070706@telepath.com> <3CD91E31.1060004@telepath.com> <3CDBD673.FF452A3D@otelco.net> <4519e058.0205140718.3ddb1b2a@posting.google.com> <3ce1424a$1@pull.gecm.com> <4519e058.0205150657.3b695758@posting.google.com> <3CE392C6.5A82A53C@brighton.ac.uk> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1021557590 5370 128.183.220.71 (16 May 2002 13:59:50 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 16 May 2002 13:59:50 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:24195 Date: 2002-05-16T13:59:50+00:00 List-Id: John English writes: > Surely the "right" way to do it is to express each value as a tuple > consisting of magnitude and the exponents of each dimension, so > 9.8 m/s**2 is (9.8, length=>1, time=>-2). Then you just have at most > three versions of each operation (tuple op tuple, tuple op magnitude, > magnitude op tuple) or even just tuple op tuple with a conversion > from magnitude to (magnitude, others=>0). Yes, that is the easiest to implement, and covers all possible units. But it has run-time overhead, which is just not acceptable in a real-time system. One approach is to use such a package during development and unit testing, to help catch unit errors. Then switch to a flat "all types are float" package for the final build and system test. If the switch can be made cleanly, and yield _no_ runtime overhead, this might be the best approach. -- -- Stephe