Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-642

Need varargs form of NumberUtils.max(), etc

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • None
    • None
    • lang.math.*
    • None

    Description

      There should be a varargs form of the NumberUtils.max() and min() functions.
      E.g. int max (int... numbers)

      This might conflict with the existing int max (int[] numbers) but that function would in fact not be needed if the varargs form existed because an array could be supplied to it just as easily.

      Or, if it is undesirable to remove max(int[] numbers), then a varargs function could be defined as
      int max (int number1, int... moreNumbers)
      which would work for any number of arguments greater than 0.

      Of course this function should be implemented for all number types (byte, short, float, double, etc) and both max() and min() should be provided.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              cogen david cogen
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: