BigInteger常用方法

时间:2021-06-25 17:05:29   收藏:0   阅读:0


BigInteger: 对大整数类进行操作,超过long能存储的范围

BigDecimal:对高精度小数进行操作


BigInteger bg = new BigInteger("0"); 初始化 并赋值为0

BigInteger类只能与BigInteger类 进行操作

 

常用方法:

bg.add( ); 加法
bg.substract( ); 减法
bg.multiply( ); 乘法
bg.divide( ); 除法
bg.sqrt( ); 开平方
bg.pow( ); 平方

BigInteger.valueOf( ); 将某类型转化成,BigInteger类型

评论(0)
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!