PSX5Central
Non Gaming Discussions => Off-Topic => Topic started by: Avatarr on January 26, 2003, 06:51:20 PM
-
One day, I wanted a list of all the prime numbers between 99999 and 1. I thought this operation wouldn\'t take /that/ long, but it can take a noticable amount of time. This\'d be an interesting twist on the 3dMark contests you may have had in the past. :p
Download the binary from here:
http://homepages.ihug.com.au/~lagunad/plgen/plgen.htm
(click on PLGEN Binary on the side bar)
And then tell us ur results. I\'m not sure why, but it does get a tad faster each time you run the .exe . Prolly all the branch prediction stuff working along. So for consistency\'s sake, only post your results for the first run.
Me:
157 seconds on the first run.
-
I actually wrote a program that can do that for you, I\'ll show you my personal version tomorrow.
I\'m a better programmer :)
-
If its already written, u can post the source code here. :p
-
what language you using, mine is written in Java.
But my program is at school so I\'ll have to wait til tomorrow. I have several programs that are very effective, I\'ll be moving on to something new on Monday.
-
C++
I\'ll bet its slower just given the fact that its written in Java, even if you did use the Euclidian Algorithm. Did u use the Euclidian Algorithm, btw. Why do you claim its "better"? Can u tell us a little bit about your "better" program?
-
192 seconds. I suck.
I do like the naked picture of Tyra Banks at the end. Nice touch.
-
:)
-
156 seconds for me..
-
I set it going 10 mins ago, its just past the half way mark.
EDIT: the second half was much quicker, total time 1140 secs!:laughing:
-
155 seconds.
did i win ;).
-
bah you guys suck
102 seconds!!!!!!
-
Originally posted by Kurt Angle
I set it going 10 mins ago, its just past the half way mark.
EDIT: the second half was much quicker, total time 1140 secs!:laughing:
:D yes. The primality checker thingy goes through each number between the number itself down to 1, seeing if there\'s a number in there that is a factor. I\'ve been told that you only need to start checking from the square root of the number. (sounds fairly reasonable). And that Euclidian Algorithm puts it down to just a bearable number of steps. :p
But sif you\'d trade efficiency for a total time of 1140 secs!!
Still waiting for that little program of urs Hurri. HURRY :D :p
(pun intended)
-
p2.4b oc\'ed to 2.7 for this test & 3dmark.
83 sec
-
Gee THX, that\'s really really fast! Let\'s see if anyone can break the 60 seconds barrier! But while we\'re on the subject of fast, lets jump to the subject of slow. Hurricane is really taking his time with that program of his. :p Just thought I\'d put in a reminder. :)
-
well I didn\'t go to school yesterday cause I was sick and thats where my program is.
it doesn\'t do 1 to 9999, it does 1 to n where n can be any number greater than 1, I\'ll post it today when I get the chance.
-
Actually this program is used for factors...
public class testloop2
{
//Andrew Loomis 01-23-03
//Project Name: test-loop-2
//This program is designed to find the factors from one to any positive
//integer (n).
public static void main(String args[])
throws java.io.IOException
{
EasyReader Keyboard = new EasyReader();
int n;
char again;
System.out.print("This program is designed to find the factors ");
System.out.print("\\nfrom one up to and including a positive integer (n). ");
do
{
System.out.print("\\n\\nFind the factors from 1 to ");
n = Keyboard.readInt();
while (n <= 0)
{
System.out.print("\\nPlease enter a positive non-zero integer: ");
n = Keyboard.readInt();
}
System.out.print("\\n");
for (int i = 1; i <= n; i++)
if (n % i == 0)
System.out.print(i + ", ");
System.out.print("\\n\\nWould you like to use this program again? ");
again = Keyboard.readChar();
Keyboard.readLine();
}
while ((again == \'Y\') || (again == \'y\'));
System.out.print("\\n\\nThank you for using my program.");
}
}
-
a mod operation inside a for loop...
isn\'t that cute.
-
well, I\'m still working on improvements. I\'ll have better stuff in coming months.
-
576 god i need a new pc. Come on tax return
-
124 sec.
-
104
-
201 not too bad but its a pos p3 1.0 so its to be expected
-
131