All pastes #387527 Raw Edit

Miscellany

public java v1 · immutable
·published 2007-03-09 12:47 UTC
rendered paste body
import java.lang.Math;public class PrimeFinder {		public static boolean evaluate(double number) {			double limit = Math.sqrt(number) + 2;				for ( double check=3; check <= limit; check+=2 ) {						if ( number%check == 0) {								return false;							}					}				return true;				}		public static void main (String[] argv) {				double limit = Math.pow(10, 6);				for ( double i=3; i < limit; i+=2 ) {					if ( evaluate(i) ) {							System.out.println(i);						}					}				}		}