DfType (@NotNull DfType other, boolean exact) { if (other.isSuperType(this)) return other; if (other instanceof DfDoubleRangeType) { return ((DfDoubleRangeType)other).join(this, exact); } if (other instanceof DfDoubleConstantType) { double val1 = getValue(); double val2 = ((DfDoubleConstantType)other).getValue(); if (Double.isNaN(val1)) { return DfDoubleRangeType.create(val2, val2, false, true); } if (Double.isNaN(val2)) { return DfDoubleRangeType.create(val1, val1, false, true); } double from = Math.min(val1, val2); double to = Math.max(val1, val2); // We don't support disjoint sets, so the best we can do is to return a range from min to max return exact ? null : DfDoubleRangeType.create(from, to, false, false); } return exact ? null : DfType.TOP; }