常用大数运算实例.docVIP

  • 7
  • 0
  • 约6.46千字
  • 约 4页
  • 2017-09-05 发布于浙江
  • 举报
常用大数运算实例

大数运算实例 BigInteger a=new BigInteger(“3”); BigInteger b=new BigInteger(“2”); BigInteger sum=a.add(b); //加 BigInteger difference=a.subtract(b); //减 BigInteger product=a.multiply(b); //乘 BigInteger quotient=a.divideb); //商 BigInteger rem=a.remainder(b); //余 1. 求商、余 ? public BigInteger[] divideAndRemainder(BigInteger val) throws ArithmeticException Since most division algorithms produce the quotient and the remainder at the same time, a more efficient way of capturing both of these values is provided by the divideAndRemainder() method. 实例. The answers are returned in an array of two BigIntegers,

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档