@Override public boolean compare( final double dataMin, final double dataMax, final double queryMin, final double queryMax) { return (FloatCompareUtils.checkDoublesEqual(dataMin, queryMin)) && (FloatCompareUtils.checkDoublesEqual(dataMax, queryMax)); } }
@Override public boolean compare( final double dataMin, final double dataMax, final double queryMin, final double queryMax) { return (FloatCompareUtils.checkDoublesEqual(dataMin, queryMax)) || (FloatCompareUtils.checkDoublesEqual(dataMax, queryMin)); } },
/** * The == operator is not reliable for doubles, so we are using this method to check if two * doubles are equal * * @param x * @param y * @return true if the double are equal, false if they are not */ public static boolean checkDoublesEqual(double x, double y) { return checkDoublesEqual(x, y, COMP_EPSILON); }
@Override public boolean equals(final Object obj) { if (obj instanceof Length) { final Length objLength = (Length) obj; return FloatCompareUtils.checkDoublesEqual(objLength.lengthKM, lengthKM); } return false; }
private double binSize() { final double v = (maxValue - minValue) / count.length; return (FloatCompareUtils.checkDoublesEqual(v, 0.0)) ? 1.0 : v; }
/** equals - compare ecf position (x,y,z) for equality */ @Override public boolean equals(final Object obj) { if (obj == null) { return false; } if (!(obj instanceof EarthVector)) { return false; } final EarthVector coord = (EarthVector) obj; return (FloatCompareUtils.checkDoublesEqual(coord.getX(), ecfVector.x) && FloatCompareUtils.checkDoublesEqual(coord.getY(), ecfVector.y) && FloatCompareUtils.checkDoublesEqual(coord.getZ(), ecfVector.z)); }
private static int getRanges(final MultiDimensionalNumericData indexedData) { final double[] mins = indexedData.getMinValuesPerDimension(); final double[] maxes = indexedData.getMaxValuesPerDimension(); int ranges = 0; for (int d = 0; d < mins.length; d++) { if (!FloatCompareUtils.checkDoublesEqual(mins[d], maxes[d])) { ranges++; } } return ranges; }
if ((totalCount == 0L) || FloatCompareUtils.checkDoublesEqual(minValue, num)) { count[0] += amount; minValue = num; maxValue = Math.max(num, maxValue); else if (FloatCompareUtils.checkDoublesEqual(maxValue, minValue)) { // &&
if (FloatCompareUtils.checkDoublesEqual(Math.max(max, chg), chg)) { position = count; max = chg;
endMillis = (long) range.getMax(); fullExtent = FloatCompareUtils.checkDoublesEqual(range.getMax(), maxOfBin); } else { endMillis = maxOfBin;
if (FloatCompareUtils.checkDoublesEqual(range.getMin(), range.getMax())) { && !((FloatCompareUtils.checkDoublesEqual(normalizedMax, -1) && (FloatCompareUtils.checkDoublesEqual(normalizedMin, 0))))) {
if (FloatCompareUtils.checkDoublesEqual(prevValue, value, WEIGHT_EPSILON)) { percentile = prevPct; } else {
if (!FloatCompareUtils.checkDoublesEqual( event.DetailLatitude.get(), Stanag4676EventWritable.NO_DETAIL) && !FloatCompareUtils.checkDoublesEqual( event.DetailLongitude.get(), Stanag4676EventWritable.NO_DETAIL)) { Double detailElevation = null; Geometry detailGeometry = null; if (!FloatCompareUtils.checkDoublesEqual( event.DetailLatitude.get(), Stanag4676EventWritable.NO_DETAIL) && !FloatCompareUtils.checkDoublesEqual( event.DetailLongitude.get(), Stanag4676EventWritable.NO_DETAIL)) { if (!FloatCompareUtils.checkDoublesEqual( firstEvent.DetailLatitude.get(), Stanag4676EventWritable.NO_DETAIL) && !FloatCompareUtils.checkDoublesEqual( firstEvent.DetailLongitude.get(), Stanag4676EventWritable.NO_DETAIL) && !FloatCompareUtils.checkDoublesEqual( lastEvent.DetailLatitude.get(), Stanag4676EventWritable.NO_DETAIL) && !FloatCompareUtils.checkDoublesEqual( lastEvent.DetailLongitude.get(), Stanag4676EventWritable.NO_DETAIL)) {