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-Thread: 103376,2a34b7ad6c6a0774 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Efficiency of code generated by Ada compilers Date: Thu, 12 Aug 2010 20:23:37 +0100 Organization: A noiseless patient Spider Message-ID: References: <1jn1a4o.1dfllwo1uin3imN%csampson@inetworld.net> <1jn36d6.se2f0g1edjjnyN%csampson@inetworld.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Thu, 12 Aug 2010 19:23:39 +0000 (UTC) Injection-Info: mx03.eternal-september.org; posting-host="KCXegvZb5vh43D+f3BR6Ew"; logging-data="19075"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/nFk8nok7D9aRJaMx4IyQ/z/PORMq+VxA=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (darwin) Cancel-Lock: sha1:2RL+21HZnB9MVpt6cUTh1404v1s= sha1:oYZWhP62ZNwFDZzjZzltEBBUgls= Xref: g2news1.google.com comp.lang.ada:13187 Date: 2010-08-12T20:23:37+01:00 List-Id: csampson@inetworld.net (Charles H. Sampson) writes: > Simon Wright wrote: > >> csampson@inetworld.net (Charles H. Sampson) writes: >> >> > I then overloaded "+" and "-" for (Bearing, Turn_Angle) arguments >> > and Bearing return value. In those functions is where the mod 360 >> > occurred. (Actually, mod 360.0, as it were.) >> >> Depending on what is doing the turning, in our application that would >> in some cases have to be mod 720.0 ... > > I'm puzzled. Unless you're very careful, intermediate calculations > could result in a quasi-Bearing of more than 360 degrees but I'm pretty > sure most programmers on my project would have been surprised to see a > real bearing of 360 degrees or more. A tracker radar like this one (hope the link will work) might be able to turn through an unlimited number of revolutions, or (with a more mechanical design) there might be a limit on how many revs it could manage. So if it's currently pointing 10 degrees to starboard, how much further can it go before having to unwind? I agree that this is Training, not Bearing, of course. http://www.artisan3d.co.uk/static/bae_cimg_radar_Fi_latestReleased_bae_cimg_radar_Fi_Web.jpg