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: a07f3367d7,47fc49812a5e8e38 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!z8g2000yqz.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: small example, using complex variables in Ada Date: Thu, 10 Jun 2010 07:54:13 -0700 (PDT) Organization: http://groups.google.com Message-ID: <9648de08-0477-40d7-a2ea-0e13e771e94d@z8g2000yqz.googlegroups.com> References: <6e70b80b-3030-479f-8378-d1281d1fa847@d37g2000yqm.googlegroups.com> NNTP-Posting-Host: 153.98.68.197 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1276181654 21726 127.0.0.1 (10 Jun 2010 14:54:14 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 10 Jun 2010 14:54:14 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z8g2000yqz.googlegroups.com; posting-host=153.98.68.197; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:12571 Date: 2010-06-10T07:54:13-07:00 List-Id: On Jun 10, 5:48=A0pm, Colin Paul Gloster wrote: > On Wed, 9 Jun 2010, Ludovic Brenta sent: > > | =A0 =A0 Two_Pi_Over_N : constant :=3D 2 * Pi / N;| > > That is a good suggestion. > > |" =A0 =A0 FOR k in X'range LOOP" =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| > > No. Why? > |" =A0 =A0 =A0 =A0 FOR m in data'range LOOP =A0 =A0 =A0 =A0 =A0| > > No. Loop down to zero. Why? > If utilizing FOR instead of WHILE, then utilize REVERSE. Generally, FOR is much better than WHILE because, the instant you see FOR, you know the loop is finite; the moment you see WHILE you must look at the exit condition and the body of the loop before you know whether it terminates or not. > Additionally, loop unrolling should be considered. I agree with this but the solution would be less general. -- Ludovic Brenta.