edu.rit.hyb.prime
Class Prime32File
- java.lang.Object
-
- edu.rit.hyb.prime.Prime32File
-
public class Prime32File extends java.lang.ObjectClass Prime32File is a sequential program that stores a list of 32-bit prime numbers in a file.Usage: java edu.rit.hyb.prime.Prime32File primefile
primefile = Output prime fileThe program calculates all odd primes less than 232. The program stores a series of values in the output prime file. Each value is stored as an unsigned byte. Each value is the difference between two consecutive odd primes, divided by 2.
The odd primes are 3, 5, 7, 11, 13, 17, 19, 23, . . .
The differences between consecutive odd primes are 2, 2, 4, 2, 4, 2, 4, . . .
The bytes stored in the output prime file are the differences divided by 2, namely 1, 1, 2, 1, 2, 1, 2, . . .
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static voidmain(java.lang.String[] args)Main program.
-
DMelt 3.0 © DataMelt by jWork.ORG