List of utility methods to do Double to Boolean
boolean | doubleToBoolean(double d) double To Boolean return d != 0 ? true : false;
|
boolean | doubleToBoolean(double value) double To Boolean if (Math.abs(1 - value) < epsilon) { return true; } else if (Math.abs(value) < epsilon) { return false; } else throw new RuntimeException("Failed to convert to boolean, not near zero or one: " + value); |
boolean[] | doubleToBoolean(double[] values) double To Boolean if (values == null) { return null; boolean[] results = new boolean[values.length]; for (int i = 0; i < values.length; i++) { results[i] = (values[i] != 0); return results; ... |
boolean | doubleToboolean(final double value) double Toboolean return value != 0;
|