Guava系列:BigIntegerMath/LongMath/IntMath使用方法

阅读 32

2022-01-31


场景

BigIntegerMath/LongMath/IntMath


demo

package com.nio4444.demo;

import com.google.common.math.BigIntegerMath;
import com.google.common.math.IntMath;
import com.google.common.math.LongMath;

import java.math.BigInteger;
import java.math.RoundingMode;

public class IntMathDemo {
public static void main(String[] args) {
System.out.println(BigIntegerMath.divide(BigInteger.TEN, new BigInteger("2"), RoundingMode.UNNECESSARY));
System.out.println( LongMath.divide(343,22, RoundingMode.FLOOR)) ;
IntMath.checkedAdd(2000000000,999999999) ;
}
}

Guava系列:BigIntegerMath/LongMath/IntMath使用方法_java


精彩评论(0)

0 0 举报