From d1dfbd273e5bdae49d21b7bfc46fd0426881f729 Mon Sep 17 00:00:00 2001 From: ZhouXY108 Date: Sat, 27 May 2023 04:09:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20BigDecimal=20=E7=9A=84=20e?= =?UTF-8?q?qual=20=E6=96=B9=E6=B3=95=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zhouxy/plusone/commons/util/BigDecimals.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/main/java/xyz/zhouxy/plusone/commons/util/BigDecimals.java diff --git a/src/main/java/xyz/zhouxy/plusone/commons/util/BigDecimals.java b/src/main/java/xyz/zhouxy/plusone/commons/util/BigDecimals.java new file mode 100644 index 0000000..bc1b623 --- /dev/null +++ b/src/main/java/xyz/zhouxy/plusone/commons/util/BigDecimals.java @@ -0,0 +1,14 @@ +package xyz.zhouxy.plusone.commons.util; + +import java.math.BigDecimal; + +public class BigDecimals { + + public static boolean equals(BigDecimal a, BigDecimal b) { + return (a == b) || (a != null && a.compareTo(b) == 0); + } + + private BigDecimals() { + throw new IllegalStateException("Utility class"); + } +}