Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 对于精确的大数字,使用什么?_Android_Variables - Fatal编程技术网

Android 对于精确的大数字,使用什么?

Android 对于精确的大数字,使用什么?,android,variables,Android,Variables,我需要一种精确存储大量数字的方法。假设我希望变量中有1'234'567'890.123456。我曾考虑过使用字符串(虽然不推荐使用),但我相信一定有更好的方法可以做到这一点。提供任意精度的数字。它是可序列化的,因此您可以这样保存它,或者使用toString()并保存该表示形式。看一看。它们是不可变的、任意精度的有符号十进制数。类似于BigDecimal的东西?我要看一看,谢谢你的回答:)它似乎很有希望,我要在我的代码中尝试一下。好的,也谢谢你的回答,尽管Fractal扳手是一个致命的工具:p

我需要一种精确存储大量数字的方法。假设我希望变量中有1'234'567'890.123456。我曾考虑过使用字符串(虽然不推荐使用),但我相信一定有更好的方法可以做到这一点。

提供任意精度的数字。它是可序列化的,因此您可以这样保存它,或者使用toString()并保存该表示形式。

看一看。它们是不可变的、任意精度的有符号十进制数。

类似于BigDecimal的东西?我要看一看,谢谢你的回答:)它似乎很有希望,我要在我的代码中尝试一下。好的,也谢谢你的回答,尽管Fractal扳手是一个致命的工具:p