Compare two doubles within a given epsilon. @param a first operand @param b second operand @param eps the epsilon (or deadband) @return TRUE {@literal if abs(a - b) < eps}, else FALSE
(final double a, final double b, final double eps)
| 160 | * @return TRUE {@literal if abs(a - b) < eps}, else FALSE |
| 161 | */ |
| 162 | public static boolean compareDouble(final double a, final double b, final double eps) |
| 163 | { |
| 164 | // If the difference is less than epsilon, treat as equal. |
| 165 | return Math.abs(a - b) < eps; |
| 166 | } |
| 167 | |
| 168 | /** |
| 169 | * Compare two doubles within an epsilon of 0.0001. |