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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no 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 Path: g2news1.google.com!postnews.google.com!v15g2000yqe.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Elias_Salom=E3o_Helou_Neto?= Newsgroups: comp.lang.ada Subject: Re: Efficiency of code generated by Ada compilers Date: Fri, 13 Aug 2010 08:08:42 -0700 (PDT) Organization: http://groups.google.com Message-ID: <61f149b9-00ff-40cd-9698-01e69fdc5c0f@v15g2000yqe.googlegroups.com> References: <1jn1a4o.1dfllwo1uin3imN%csampson@inetworld.net> <1jn36d6.se2f0g1edjjnyN%csampson@inetworld.net> NNTP-Posting-Host: 143.107.183.162 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1281712122 27871 127.0.0.1 (13 Aug 2010 15:08:42 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 13 Aug 2010 15:08:42 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v15g2000yqe.googlegroups.com; posting-host=143.107.183.162; posting-account=8auP9QoAAACkSx2qxJhP83KA6-tg78E8 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.99 Safari/533.4,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:13221 Date: 2010-08-13T08:08:42-07:00 List-Id: On Aug 12, 5:21=A0pm, "(see below)" wrote: > On 12/08/2010 20:23, in article m28w4bfxdy....@pushface.org, "Simon Wrigh= t" > > > > > > wrote: > > csamp...@inetworld.net (Charles H. Sampson) writes: > > >> Simon Wright wrote: > > >>> csamp...@inetworld.net (Charles H. Sampson) writes: > > >>>> =A0 =A0 =A0I then overloaded "+" and "-" for (Bearing, Turn_Angle) a= rguments > >>>> and Bearing return value. =A0In those functions is where the mod 360 > >>>> occurred. =A0(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 ... > > >> =A0 =A0 =A0I'm puzzled. =A0Unless you're very careful, intermediate ca= lculations > >> could result in a quasi-Bearing of more than 360 degrees but I'm prett= y > >> 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 t= o > > 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_ba... > > dar_Fi_Web.jpg > > I think quantum mechanics codes would require angles mod 720 for spin 1/2 > particles. 8-) > > -- > Bill Findlay > chez blueyonder.co.uk Well, we are definitely drifting away from the original question. So much that I am considering to give up reading answers from this post... Anyway, someone prematurely implied that I may be doing premature optimization. The fact is that I do know, from profiling, how important is _not_ to range check in my specific application, so I will try to give you a "bottom line" of what have been said that really matters to me. 1) You can, in more than one way, tell the compiler to suppress most (any?) checks, but people do not advise to do so. Even if I say that I do need that :( 2) It is not necessary for the compiler to actually suppress any checking! It seems that the LRM demands the compiler to allow you to ask for the suppression, but it does mandate the compiler to actually skip such checks. Well, this is, to say the least, funny - unless I misunderstood something here. I am having a fairly good impression of Ada's features, but the effort it would take to learn the language may eventually not pay off. Thank you, Elias. P.S: Multidimensional _arrays_ are not multidimensional _matrices_ neither are them MD _images_. The two latter are far more specific classes and the last case even needs to be templated in, say, pixel type, etc.