DfType (float from, float to, boolean invert, boolean nan) { assert !Float.isNaN(from); assert !Float.isNaN(to); if (Float.compare(from, to) > 0) { return nan ? new DfFloatConstantType(Float.NaN) : DfType.BOTTOM; } if (to == Float.POSITIVE_INFINITY && from == Float.NEGATIVE_INFINITY) { if (invert) { return nan ? new DfFloatConstantType(Float.NaN) : DfType.BOTTOM; } return new DfFloatRangeType(from, to, false, nan); } if (to == Float.POSITIVE_INFINITY) { to = nextDown(from); from = Float.NEGATIVE_INFINITY; invert = !invert; } if (!nan && !invert && Float.compare(from, to) == 0) { return new DfFloatConstantType(from); } if (!nan && invert && from == Float.NEGATIVE_INFINITY && to == nextDown(Float.POSITIVE_INFINITY)) { return new DfFloatConstantType(Float.POSITIVE_INFINITY); } return new DfFloatRangeType(from, to, invert, nan); }