Release Note: `Math.clamp()` and `StrictMath.clamp()` Methods

XMLWordPrintable

      The methods `Math.clamp()` and `StrictMath.clamp()` are added to conveniently clamp the numeric value between the specified minimum and maximum values. Four overloads are provided in both `Math` and `StrictMath` classes for `int`, `long`, `float`, and `double` types. A `clamp(long value, int min, int max)` overload can also be used to safely narrow a `long` value to `int`.

            Assignee:
            Tagir Valeev
            Reporter:
            Tagir Valeev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: