BigInteger的使用

【构造方法】

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]为余数。

posted @ 2018-02-15 14:47  Schiller_Hu  阅读(289)  评论(0编辑  收藏  举报