天天看點

【Java程式設計】Java中的大整數計算

結果顯示如下:

int

傳回此 BigInteger 最右端(最低位)1 比特的索引(即從此位元組的右端開始到本位元組中最右端 1 比特之間的 0 比特的位數)。

傳回此 BigInteger 的哈希碼。

boolean

certainty) 如果此 BigInteger 可能為素數,則傳回 true,如果它一定為合數,則傳回 false。

long

BigInteger 轉換為 long。

<a target="_blank" href="">BigInteger</a>

val) 傳回此 BigInteger 和 val 的最大值。

val) 傳回此 BigInteger 和 val 的最小值。

m) 傳回其值為 (this mod m) 的 BigInteger。

m) 傳回其值為 (this-1 mod m) 的 BigInteger。

val) 傳回其值為 (this * val) 的 BigInteger。

傳回其值是 (-this) 的 BigInteger。

傳回大于此 BigInteger 的可能為素數的第一個整數。

傳回其值為 (~this) 的 BigInteger。

val) 傳回其值為 (this | val) 的 BigInteger。

exponent) 傳回其值為 (thisexponent) 的 BigInteger。

val) 傳回其值為 (this % val) 的 BigInteger。

n) 傳回其值與設定了指定位的此 BigInteger 等效的 BigInteger。

n) 傳回其值為 (this &lt;&lt; n) 的 BigInteger。

n) 傳回其值為 (this &gt;&gt; n) 的 BigInteger。

val) 傳回其值為 (this - val) 的 BigInteger。

byte[]

傳回一個 byte 數組,該數組包含此 BigInteger 的二進制補碼表示形式。

<a target="_blank" href="">String</a>

傳回此 BigInteger 的十進制字元串表示形式。

radix) 傳回此 BigInteger 的給定基數的字元串表示形式。

val) 傳回其值等于指定 long 的值的 BigInteger。

val) 傳回其值為 (this ^ val) 的 BigInteger。

作者:nineheadedbird