A friend of mine has written a program to calculate the first 10000 prime numbers...consider it a benchmark of sorts (trying to see if my pc or his mac is better ). Here is the source code, but whenever we try to calculate more than 2 prime numbers, we get an error. Any advice? Thanks in advance
I attached the code, but its a .txt file...if you just want to copy and paste it into a compiler and execute, i'd appreciate it.
The program was created on a mac, ran fine on there, but cannot run on gcc or in visual studio
...this is not a g5 machine...its a g4 laptop vs. a 2700+ desktop. we are benchmarking basic low level stuff like mathematical computations to see who's computer is more effective
...we want to write our own program to determine whos is more effective...its a simple .c file that can be compiled on both machines, ran, and have the results compared...with regard to the "fastest pc ever", I dont think they'd say "Its pretty fast, but boy does AMD got us in this one..." We want to find out for ourselves
wouldn't calculating the first 10,000 prime numbers benchmark the processors of each machine by telling how long it took to get there?
*problem solved* The problem was traced down to an error with displaying the prime numbers to the screen...once this was enabled, everything ran fine...fyi the 2700+ was 33% faster than the g4 1ghz at calculating the prime numbers
we still have not figured out why the mac g4 was able to run the "benchmark" program without displaying the numbers without a hitch, while the AMD machine coudln't...we tried it on an intel box, and instead of an arithmetic exception, we got a floating point error...so we are assuming that it is a processor-dependent thing, perhaps the g4 is more forgiving in this case....regardless of which, it worked on both machines with displaying the numbers as they were calculated...the AMD machine ended up being about 33% faster...but considering the AMD was a 2700+ and the g4 was a 1ghz processor, 33% isn't too spectacular...
qball,
its hard to answer "what is the best car", but you can answer questions like "what car does 0-60 the quickest" or "which car taks the shortest distance to brakefrom 100mph"....what we were trying to ask was "which car can go from 0-10000 prime numbers the fastest" Right now we are considering other ways that we can test these computers to continue the benchmarks we have started....thank you all for the advice given