Public feed #722460

Someone

public text v1 · immutable
Raw Edit
·published 2007-10-02 00:38 UTC
rendered paste body
static boolean isPrime(int toTest){
	if(toTest!=2&&toTest%2==0){
	    return false;
	}
	if(toTest == 1||toTest == 0){
	    return false;
	}
	for(int i = 3, limit=(int)Math.sqrt(toTest);i<=limit;i+=2){
	    if(toTest%i==0)
		return false;
	}
	return true;
    }