Guest User

Untitled

a guest
Aug 17th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. private static boolean isWithinTolerance(BigDecimal amount, BigDecimal tolerance) {
  2. return (amount.compareTo(tolerance.negate()) > 0 && amount.compareTo(tolerance) < 0)
  3. || amount.abs().compareTo(tolerance) == 0;
  4. }
Add Comment
Please, Sign In to add comment