boolean (@NotNull DfType other) { if (other == DfType.BOTTOM || other.equals(this)) return true; if (other instanceof DfDoubleConstantType) { double val = ((DfDoubleConstantType)other).getValue(); if (Double.isNaN(val)) return myNaN; int from = Double.compare(myFrom, val); int to = Double.compare(val, myTo); return (from <= 0 && to <= 0) != myInvert; } if (other instanceof DfDoubleRangeType range) { if (range.myNaN && !myNaN) return false; if (!myInvert && myFrom == Double.NEGATIVE_INFINITY && myTo == Double.POSITIVE_INFINITY) return true; int from = Double.compare(myFrom, range.myFrom); int to = Double.compare(range.myTo, myTo); if (myInvert) { if (range.myInvert) { return from >= 0 && to >= 0; } else { return Double.compare(range.myTo, myFrom) < 0 || Double.compare(range.myFrom, myTo) > 0; } } else { return !range.myInvert && from <= 0 && to <= 0; } } return false; }