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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,63043e3a9a3d050f X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!z28g2000yqh.googlegroups.com!not-for-mail From: Ada novice Newsgroups: comp.lang.ada Subject: Re: loop problem with exit condition Date: Sun, 26 Sep 2010 03:19:54 -0700 (PDT) Organization: http://groups.google.com Message-ID: <913ad41d-14f1-487e-bad6-880f9d5d8303@z28g2000yqh.googlegroups.com> References: <3087f399-2cae-4bc8-bba1-e728943473bb@e14g2000yqe.googlegroups.com> <1spdu1yb2khd0$.rk8xvebgn574.dlg@40tude.net> NNTP-Posting-Host: 193.11.22.91 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1285496394 20688 127.0.0.1 (26 Sep 2010 10:19:54 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 26 Sep 2010 10:19:54 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z28g2000yqh.googlegroups.com; posting-host=193.11.22.91; posting-account=Rr9I-QoAAACS-nOzpA-mGxtAlZ46Nb6I User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10 (.NET CLR 3.5.30729),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:14271 Date: 2010-09-26T03:19:54-07:00 List-Id: Thanks a lot. You have provided me with a very clean code that does its job well. As I was working with Long_Float precision I was tempted to believe that floating-point accumulation errors wouldn't have such an adverse effect. Apart that, I wasn't thinking very much of using the For loop instead with its unity increment (I come from a Matlab background). When writing a For loop, I read that it's good practice to put e.g. For I in Range 1..300 as just putting For I in 1..300 will not tell the compiler what kind of number representation it must have for the numbers 1 and 300. Thanks again. YC