Skip to content

[Enhancement] Please can you add a GetMinMax() style function ? #13

@Smurf-IV

Description

@Smurf-IV

Something better than this ?

    public static void GetMinMax(double[] values, out double min, out double max)
    {
        min = double.NaN;
        max = double.NaN;
        int length = values.Length;
        if (length > 0)
        {
            min = values[0];
            max = min;
            for (int i = 1; i < length; i++)
            {
                double value = values[i];
                if (min > value)
                {
                    min = value;
                }
                else if (max < value)
                {
                    max = value;
                }
            }
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions