MCPcopy Create free account
hub / github.com/PCGen/pcgen / compareDouble

Method compareDouble

code/src/java/pcgen/core/utils/CoreUtility.java:162–166  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers 1

doublesEqualMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected