# Compare the decimal outputs to the first 130 digits of pi, which are:
# [1] 3 . 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4
# [26] 3 3 8 3 2 7 9 5 0 2 8 8 4 1 9 7 1 6 9 3 9 9 3 7 5
# [51] 1 0 5 8 2 0 9 7 4 9 4 4 5 9 2 3 0 7 8 1 6 4 0 6 2
# [76] 8 6 2 0 8 9 9 8 6 2 8 0 3 4 8 2 5 3 4 2 1 1 7 0 6
# [101] 7 9 8 2 1 4 8 0 8 6 5 1 3 2 8 2 3 0 6 6 4 7 0 9 3
# [126] 8 4 4 6 0
# Lots of precision, but most of the digits are inaccurate.
(bpp(5))
# $bigq
# Big Rational ('bigq') :
# [1] 40413742330349316707/12864093722915635200
#
# $mdec
# 1 'mpfr' number of precision 400 bits
# [1] 3.14159265322808753473437803553620446955
# 852801219780193481442230321585101644290504893051
# 16201439239799241252867682875513665
# extend the series.
(bpp(20))
# $bigq
# Big Rational ('bigq') :
# [1] 6978810534836185743790248010742839687036
# 9348283327260905420704007804969465293
# 222142438704194558751308818610402859379
# 08911653929817878006825259792072704000
#
# $mdec
# 1 'mpfr' number of precision 400 bits
# [1] 3.1415926535897932384626433832513
# 62615881909316518417908555365030283
# 2142940981052934064597204233958787472300102294523391693
# Accurate but low precision
bpp(20,mpbits=20)
# $bigq
# Big Rational ('bigq') :
# [1] 6978810534836185743790248010742839
# 6870369348283327260905420704007804969465293
# 2221424387041945587513088186104028593790891
# 1653929817878006825259792072704000
#
# $mdec
# 1 'mpfr' number of precision 20 bits
# [1] 3.1415939
Run the code above in your browser using DataLab