码迷,mamicode.com
首页 > 其他好文 > 详细

BigInteger的使用

时间:2018-02-15 15:06:24      阅读:187      评论:0      收藏:0      [点我收藏+]

标签:log   str   表示   font   [1]   main   add   方法   返回   

【构造方法】

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

BigInteger的使用

标签:log   str   表示   font   [1]   main   add   方法   返回   

原文地址:https://www.cnblogs.com/schiller-hu/p/8449503.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!