Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Prime Number Programming

91 views
Skip to first unread message

KBH

unread,
Jul 19, 2012, 8:38:23 AM7/19/12
to
Here is the subject:

http://www.delphigroups.info/2/e9/3997-2.html

And when I say that I have prime number code that does not have any unnecessary operations I mean that all divisions are by prime numbers.

So that poster that jumps on a list of details just misses the point and ends up looking childish. In fact computer code is often demonstrated with the value needed evaulated each time it is needed. It just saves a variable and a line of code in the demonstration.

But then that poster does take a larger view and seems to say that overall efficiency doesn't really matter. Isn't that more childish ?

But I like the trial division prime number code even though I have moved on to other code. Once the trial division was run one time then it had prime numbers in memory array to use for the next runs. So it could get faster in use but didn't have files of prime numbers that could be deleted
.

Marco van de Voort

unread,
Jul 19, 2012, 10:06:55 AM7/19/12
to
On 2012-07-19, KBH <empt...@hotmail.com> wrote:
> Here is the subject:
>
> http://www.delphigroups.info/2/e9/3997-2.html

No that is random url with a very long discussion.

> And when I say that I have prime number code that does not have any
> unnecessary operations I mean that all divisions are by prime numbers.
> But then that poster does take a larger view and seems to say that overall
> efficiency doesn't really matter. Isn't that more childish ?

Well, of course performance doesn't matter, otherwise one would use an
optimizing compiler and not an old 16-bit TP.

> But I like the trial division prime number code even though I have moved
> on to other code. Once the trial division was run one time then it had
> prime numbers in memory array to use for the next runs. So it could get
> faster in use but didn't have files of prime numbers that could be deleted

I'm not sure what the question in this post is?

empt...@hotmail.com

unread,
Jul 19, 2012, 8:15:34 PM7/19/12
to
Oh, I didn't see page 3 of the link and thought I missed making a response ten years ago on something that google was still listing.

The better response was "Okay I see what is happening here,..." .

But prime numbers are a good programming exercise. And anything that will run in TP7 will run in Delphi console mode with minor changes.

Actually, I don't know what Delphi has been developed to but Delphi 7 is offered as a download with current versions and it has a console mode.
0 new messages