Can anyone recommend an efficient way of determining whether a BigDecimal is an integer value in the mathematical sense?
BigDecimal
At present I have
This is the cleanest I've come up with.
public static boolean isWhole(BigDecimal bigDecimal) { return bigDecimal.setScale(0, RoundingMode.HALF_UP).compareTo(bigDecimal) == 0; }