E D R S I H C RSS
ID
Password
Join
You are secretive in your dealings but never to the extent of trickery.

FrontPage isPrime

int isPrime(int num) {
	if ( num <= 1 ) { return 0; }
	if ( num <= 3 ) { return 1; }
	if ( (num & 0x1) == 0 ) { return 0; }

	int end = sqrt(num);
	for (register int i = 3; i <= end; ++i ) {
		if ( end % i ) return 0;
	}
	return 1;
}
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2016-04-13 18:03:28
Processing time 0.0366 sec