本文介绍了BigInteger如何存储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要生成512位BigInts,但是我不确定下面两个中的哪一个是正确的:
I need to generate 512 bit BigInts, but I'm not sure which of the two below is true:
512位表示1010101010...001010
的512位数字,然后将其转换为它代表的小数?
512 bits means 512 digits of 1010101010...001010
which are then converted to the decimal it represents?
或者它表示0-9
的512位数字,所以从根本上讲是一个0到9范围内的512位数字?类似于12414124124 .... 54543 = 512位数字.
Or does it mean 512 digits of 0-9
, so basicly a 512-digit number with digits ranging from 0-9? Something like 12414124124....54543=512 digits.
推荐答案
从源代码开始,它们存储在int
数组中
From sourcecode, they are stored in an int
array
118
119 int[] mag;
120
121 // These "redundant fields" are initialized with recognizable nonsense
122 // values, and cached the first time they are needed (or never, if they
123 // aren't needed).
124
这篇关于BigInteger如何存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!