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: a07f3367d7,6a8952cbe009f3ed X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.224.76.198 with SMTP id d6mr2681426qak.8.1360304413177; Thu, 07 Feb 2013 22:20:13 -0800 (PST) X-Received: by 10.49.58.238 with SMTP id u14mr367359qeq.13.1360304413158; Thu, 07 Feb 2013 22:20:13 -0800 (PST) Path: k2ni19278qap.0!nntp.google.com!p13no1873899qai.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 7 Feb 2013 22:20:12 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=130.240.232.139; posting-account=Rr9I-QoAAACS-nOzpA-mGxtAlZ46Nb6I NNTP-Posting-Host: 130.240.232.139 References: <4905b963-0036-4129-8050-fb26ef0154d6@googlegroups.com> <32314026-23ae-45b8-a4c5-e589e7d79de2@googlegroups.com> <64e3c342-d042-40a2-8a16-b1f0cdff9f16@googlegroups.com> <91527f7c-0679-4c21-95c7-a07f3fff265d@googlegroups.com> <4b654b06-f2d2-4ced-8508-c10e5c84e29d@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Numerical calculations: Why not use fixed point types for everything? From: Ada novice Injection-Date: Fri, 08 Feb 2013 06:20:13 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2013-02-07T22:20:12-08:00 List-Id: On Thursday, February 7, 2013 7:03:33 AM UTC+1, Randy Brukardt wrote: >=20 >=20 > My point was that most loops can be refactored this way unless there is s= ome=20 >=20 > varying data in them. (And the best loop execution-wise is no loop.) And= =20 >=20 > indeed, most of the loops like this that I've written involve processing= =20 >=20 > (summarizing, often) an array of data. In which case you need an array=20 >=20 > index; and usually you can convert that index into the factor by some=20 >=20 > technique. So iteration by fixed point values or the like makes for=20 >=20 > interesting examples, but won't happen that often in practice. >=20 >=20 >=20 > Randy. Thanks for your interesting message. I agree with you that one needs to sim= plify the code as far as possible. In most situations where I use loops, it= is because at each index, I am computing some new variables that need to b= e stored (for example in a time integration routine). In this case, I can't= get rid of the loop construct because of the "varying data".