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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: language defined list of prime numbers Date: Sat, 9 Dec 2017 18:13:30 +0100 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <1afe0b2c-eb71-4197-9bbb-b78532e4cd7e@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 9 Dec 2017 17:13:30 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="1bc497aaacc8af08268af68deab5bb38"; logging-data="27337"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19uW7W2b1XpviJ5abvkDKMZD7jte+4Bjrc=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 In-Reply-To: Content-Language: en-US Cancel-Lock: sha1:3U4JDJVjB2UW+YVwdaggSlqf5a4= Xref: reader02.eternal-september.org comp.lang.ada:49441 Date: 2017-12-09T18:13:30+01:00 List-Id: On 12/09/2017 06:05 PM, Mehdi Saada wrote: > I might not get what you mean. I just supposed it should mandatory to provide a list of all prime numbers between 0 and let's say, 5000 at least, in the form of a function returning the next prime after N. > I have to write a function to simplify fractions, and I very doubt the teacher wants us at this point, to implement an whole algorithm to find prime numbers (up to the squared root), just for that. To simplify fractions, all you need is the GCD algorithm. -- Jeff Carter "Ada has made you lazy and careless. You can write programs in C that are just as safe by the simple application of super-human diligence." E. Robert Tisdale 72