Class PiSpigot
java.lang.Object
net.okapia.osid.torrefacto.math.PiSpigot
An unbounded spigot generator for the decimal digits of pi. Each
call to
nextDigit() yields the next digit in order, starting
with the leading 3; the sequence has no fixed length
and the BigInteger state grows as more digits are produced.-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
PiSpigot
public PiSpigot()Constructs a newPiSpigot.
-
-
Method Details
-
nextDigit
public int nextDigit()Returns the next decimal digit of pi. Successive calls yield the digits in order, beginning with the leading3, then1,4,1, and so on.- Returns:
- the next digit, 0 through 9
-
main
Prints the digits of pi to standard output, without end, until the process is interrupted.- Parameters:
args- ignored
-