乘以非常大的小值

时间:2015-06-18 17:13:38

标签: r floating-point multiplication

作为大二项系数的结果我总结抱歉存储了一个数字作为大整数(来自gmp)包

Big Integer ('bigz') :
[1] > chooseZ(1599,999)

Big Integer('bigz'): [1] 64702725976477841685087011694882593433664461459998756503370133423490886710992479387020713114439119078572270410565905096678530812549132718109065352925330156276352159906752920126061592461003982967533637590930195693832792290806000097619179060714793020167850667221328682056807933391950779186595385360309444776548462757363488307499961774581415255778468273486215727708155489945082243963752226921889401251140938597561863975549109487674702867681182063412410767713200

现在我需要将它与

相乘
[1] 1.884357e-08

如果我转换成大整数,我得到数字1.88 e-8只是四舍五入为0,这意味着乘法是0.我怎样才能将R中的两个数相乘

2 个答案:

答案 0 :(得分:1)

你能否将你的大数除以1x10 ^ 8(整数)然后乘以18884357?

答案 1 :(得分:1)

尝试使用大理性代替:

huge <- as.bigq(yourcoef,d=1)
tiny <- as.bigq(yoursmall,d=1)
mul.bigq(huge,tiny)