presto-main/src/main/java/io/prestosql/util/MoreMath.java/MoreMath/rangeMax
class MoreMath:    public static double rangeMax(double left, double right)
    {
        if (isNaN(left)) {
            return right;
        }
        if (isNaN(right)) {
            return left;
        }
        return max(left, right);
    }