如何处理大的数字? [英] How to handle big numbers?

查看:105
本文介绍了如何处理大的数字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常大的数字,假设参与一些交易ID或赚大钱。所以,我将如何处理这些计算(加,多等等)。是否有另一种是将其存储在通用存储类型(长,很长很长等)采取这样的情况照顾?是否支持提高解决?

I have a very large number, assume some transaction id or big money involved. So, how I will handle the calculation on these ( add, multiple etc). Does any other was to store it in the generic storage type( long, long long etc) to take care of such situation? Does boost support the solution?

推荐答案

您使用处理大的数字,如 GNU的多重precision算术这似乎库的是最常见的。或者,如果你想具体升压,总有<一个href=\"http://www.boost.org/doc/libs/1_54_0/libs/multi$p$pcision/doc/html/boost_multi$p$pcision/intro.html\">the多precision库(可使用GMP作为后端)。

You use a library that handles big numbers, like The GNU Multiple Precision Arithmetic Library which seems to be the most common. Or if you want Boost specifically, there's always the Multiprecision library (which can use GMP as backend).

这篇关于如何处理大的数字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆