非常大与小值的乘法

编程入门 行业动态 更新时间:2024-10-17 00:26:37
本文介绍了非常大与小值的乘法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 作为大二项式系数的结果,我总结抱歉地存储了一个数字作为大整数(来自gmp)包

Big Integer('bigz'): [1]>选择Z(1599,999)

大整数('bigz'): [1] 64702725976477841685087011694882593433664461459998756503370133423490886710992479387020713114439119078572270410565905096678530812549132718109065352925330156276352159906752920126061592461003982967533637590930195693832792290806000097619179060714793020167850667221328682056807933391950779186595385360309444776548462757363488307499961774581415255778468273486215727708155489945082243963752226921889401251140938597561863975549109487674702867681182063412410767713200

现在我需要与

[1乘以它] 1.884357e-08

如果我转换成大整数,我得到的数字是1.88 e-8只是四舍五入为0,这意味着乘法是0.我怎样才能在R中乘以两个数字?解决方案尝试使用大理性代替:

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

as the result of a large binomial coefficient I summed sorry stored a number as big integer (from the gmp) package

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

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

now I would need to multiply it with

[1] 1.884357e-08

if I convert into big integer I get that the number 1.88 e-8 is just rounded to 0 which means the multiplication is 0. How can I multiply both numbers in R

解决方案

Try use big rational instead:

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

更多推荐

非常大与小值的乘法

本文发布于:2023-11-12 20:02:09,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1582403.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:乘法   非常大

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!