IT序号网

BigInteger的使用

xmjava 2021年05月25日 编程语言 398 0

【构造方法】

BigInteger(String val) :将 BigInteger 的十进制字符串表示形式转换为 BigInteger。

【常用方法】

1)add(BigInteger val):返回其值为 (this + val) 的 BigInteger。

2)subtract(BigInteger val):返回其值为 (this - val) 的 BigInteger。

3)multiply(BigInteger val):返回其值为 (this * val) 的 BigInteger。

4)divide(BigInteger val):返回其值为 (this / val) 的 BigInteger。

5)divideAndRemainder(BigInteger val) :返回包含 (this / val) 后跟 (this % val) 的两个 BigInteger 的数组。bi[0]为商,bi[1]为余数。


评论关闭
IT序号网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!