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,e3ba37c5a979fdcb X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news3.google.com!news.glorb.com!newspeer1.se.telia.net!se.telia.net!masternews.telia.net.!newsb.telia.net.POSTED!not-for-mail From: =?ISO-8859-1?Q?Bj=F6rn_Persson?= User-Agent: Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: invalid parameter list References: <1140249851.389233.273980@g47g2000cwa.googlegroups.com> <1140297548.116832.212770@g43g2000cwa.googlegroups.com> <57OJf.45346$d5.201767@newsb.telia.net> <1140307577.816883.185870@g43g2000cwa.googlegroups.com> <1140322000.831855.64900@g43g2000cwa.googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: <6W0Kf.45398$d5.201893@newsb.telia.net> Date: Sun, 19 Feb 2006 16:21:22 GMT NNTP-Posting-Host: 83.250.106.90 X-Complaints-To: abuse@telia.com X-Trace: newsb.telia.net 1140366082 83.250.106.90 (Sun, 19 Feb 2006 17:21:22 CET) NNTP-Posting-Date: Sun, 19 Feb 2006 17:21:22 CET Organization: Telia Internet Xref: g2news1.google.com comp.lang.ada:2994 Date: 2006-02-19T16:21:22+00:00 List-Id: Dennis Lee Bieber wrote: > For the example data (12000 .. 15000, and chain length of 30) I > encounter an overflow error. Isaac probably doesn't know yet what an overflow is. What Dennis is saying is that on his computer, this line: Sum := Sum + C + N / C; sometimes fails because the sum becomes too big. Assuming Dennis hasn't changed the type of Sum, this means that sometimes the addition results in a sum that is greater than the upper limit of Integer, whatever that limit is on Dennis' platform. I can show you ways around this problem, but first you should fix your implementation of Sum_Of_Divisors and get your program through the compiler. Once your program produces correct results for short chains we'll see if the Constraint_Error turns out to be a problem and what we can do about it. You had a version of Sum_Of_Divisors that was correct but a bit inefficient. Then you replaced it with a version that's more efficient but incorrect. You need to fix it so that it always returns the same result as the first version you posted. -- Bj�rn Persson PGP key A88682FD omb jor ers @sv ge. r o.b n.p son eri nu