Wikipedia says
As of January 2016, the largest known prime number is 274,207,281 − 1, a number with 22,338,618 digits.
and about PI:
In September 2010, a Yahoo! employee used the company's Hadoop application on one thousand computers over a 23-day period to compute 256 bits of π at the two-quadrillionth (2×1015th) bit, which also happens to be zero.
Obviously I don't need use numbers with that magnitude, but just of curiosity, for the sake of the Science, How someone can work/generate so large numbers? Maybe when it is out of RAM, the app dumps all digits for disk, clean the memory and continues the process? And about the data type used to calculate it?
The Java classes BigInteger and BigDecimal have arbitrary precision so that should work when the problem still fits in memory.
The fact that Yahoo! is using Hadoop for their Pi computation suggests that the digits may be stored to disk in a distributed manner using HDFS
.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments