if (compareResult < 0) {
System.out.println(“a가 b보다 작다.”);
}
if (compareResult == 0) {
System.out.println(“a와 b가 같다.”);
}
if (compareResult > 0) {
System.out.println(“a가 b보다 크다.”);
}
더하기, 빼기, 곱하기, 나누기는 각각
add, subtract, multiply, divide 함수를 활용하여 계산할 수 있다.
Java BigDecimal 크기 비교하기, bigdecimal 비교