R中带有Rmpfr的科学记数法
我正在测试一些基于R中R中带有Rmpfr的科学记数法,r,scientific-notation,mpfr,R,Scientific Notation,Mpfr,我正在测试一些基于R中Rmpfr示例代码的计算 测试如下: ns使用scipen=0 library(Rmpfr) options(scipen = 999) ns <- mpfr(1:24, 120) ; factorial(ns) # 24 'mpfr' numbers of precision 120 bits # [1] 1e0 2e0
Rmpfr
示例代码的计算
测试如下:
ns使用scipen=0
library(Rmpfr)
options(scipen = 999)
ns <- mpfr(1:24, 120) ; factorial(ns)
# 24 'mpfr' numbers of precision 120 bits
# [1] 1e0 2e0 6e0
# [4] 2.e1 1.e2 7.e2
# [7] 5.0e3 4.03e4 3.628e5
# [10] 3.628e6 3.9916e7 4.79001e8
# [13] 6.227020e9 8.7178291e10 1.30767436e12
# [16] 2.092278988e13 3.5568742809e14 6.40237370572e15
# [19] 1.2164510040883e17 2.4329020081766e18 5.10909421717094e19
# [22] 1.1240007277776076e21 2.58520167388849766e22 6.204484017332394393e23
options(scipen = 0)
ns <- mpfr(1:24, 120) ; factorial(ns)
# 24 'mpfr' numbers of precision 120 bits
# [1] 1 2 6
# [4] 24 120 720
# [7] 5040 40320 362880
# [10] 3628800 39916800 479001600
# [13] 6227020800 87178291200 1307674368000
# [16] 20922789888000 355687428096000 6402373705728000
# [19] 121645100408832000 2432902008176640000 51090942171709440000
# [22] 1124000727777607680000 25852016738884976640000 620448401733239439360000
库(Rmpfr)
选项(scipen=999)
ns我使用了选项(scipen=999)
,似乎对我不起作用?使用选项(scipen=0)
可能重复的显然不是,这是两种情况
[1] 1 2
[3] 6 24
[5] 120 720
[7] 5040 40320
[9] 362880 3628800
[11] 39916800 479001600
[13] 6227020800 87178291200
[15] 1307674368000 20922789888000
[17] 355687428096000 6402373705728000
[19] 121645100408832000 2432902008176640000
[21] 51090942171709440000 1124000727777607680000
[23] 25852016738884976640000 620448401733239439360000
library(Rmpfr)
options(scipen = 999)
ns <- mpfr(1:24, 120) ; factorial(ns)
# 24 'mpfr' numbers of precision 120 bits
# [1] 1e0 2e0 6e0
# [4] 2.e1 1.e2 7.e2
# [7] 5.0e3 4.03e4 3.628e5
# [10] 3.628e6 3.9916e7 4.79001e8
# [13] 6.227020e9 8.7178291e10 1.30767436e12
# [16] 2.092278988e13 3.5568742809e14 6.40237370572e15
# [19] 1.2164510040883e17 2.4329020081766e18 5.10909421717094e19
# [22] 1.1240007277776076e21 2.58520167388849766e22 6.204484017332394393e23
options(scipen = 0)
ns <- mpfr(1:24, 120) ; factorial(ns)
# 24 'mpfr' numbers of precision 120 bits
# [1] 1 2 6
# [4] 24 120 720
# [7] 5040 40320 362880
# [10] 3628800 39916800 479001600
# [13] 6227020800 87178291200 1307674368000
# [16] 20922789888000 355687428096000 6402373705728000
# [19] 121645100408832000 2432902008176640000 51090942171709440000
# [22] 1124000727777607680000 25852016738884976640000 620448401733239439360000