List of utility methods to do BigDecimal Equal
boolean | bigDecimalEqual(BigDecimal a, BigDecimal b) big Decimal Equal return (a == b) || (a != null && b != null && a.compareTo(b) == 0);
|
boolean | bigDecimalEquals(BigDecimal a, Number b) big Decimal Equals if (b instanceof BigDecimal) { return bigDecimalEquals(a, (BigDecimal) b); } else if (b instanceof BigInteger) { return bigDecimalEquals(a, new BigDecimal((BigInteger) b)); } else { return false; |
boolean | bigDecimalEqualsOrBothNull(BigDecimal obj1, BigDecimal obj2) big Decimal Equals Or Both Null if (obj1 == null && obj2 == null) { return true; if (obj1 != null && obj2 != null) { return obj1.compareTo(obj2) == 0; return false; |
boolean | equalBD(BigDecimal val1, BigDecimal val2) Bepaalt of 2 BigDecimals gelijk zijn. if (val1 == null && val2 == null) { return true; if ((val1 == null && val2 != null) || (val2 == null && val1 != null)) { return false; return (val1.compareTo(val2) == 0); |
boolean | equals(BigDecimal a, BigDecimal b) equals return (a == b) || (a != null && a.compareTo(b) == 0);
|
boolean | equals(BigDecimal bd1, BigDecimal bd2) equals return isZero(doubleValue(bd1) - doubleValue(bd2));
|
boolean | equals(BigDecimal decimal, double number) equals return equals(decimal, new BigDecimal(number)); |
boolean | equals(BigDecimal left, BigDecimal right, int scale) equals if (left == null || right == null) { return (left == right); if (scale <= 0) { scale = Math.min(left.scale(), right.scale()); } else scale = Math.min(Math.min(left.scale(), right.scale()), scale); ... |
boolean | Equals(BigDecimal one, BigDecimal two) Returns true if one == two return (one.compareTo(two) == 0);
|
boolean | equals(final BigDecimal b0, final BigDecimal b1, final double delta) Null safe equals with accepted delta. if (b0 == b1) { return true; } else if (b0 == null || b1 == null) { return false; } else { return b0.subtract(b1).abs().compareTo(BigDecimal.valueOf(Math.abs(delta))) <= 0; |