close enough, but try checking only odd number against odd numbers.
try this instead:
you'll find this to be MUCH faster - and i found a few glitches in your code...Code:for( int x = 3; x < 32000000; x+= 2) { for(int y = 3; y * y <= x; y+= 2) { if( x % y == 0) { //number x isnt prime break; } } }
and to thread that code, i just made a few tweaks and used a library called pthreads



Reply With Quote
Bookmarks