Re: RFR: 8301226: Add clamp() methods to java.lang.Math and to StrictMath [v8]

2023-02-14 Thread Karl T
On Tue, 7 Feb 2023 12:53:25 GMT, Tagir F. Valeev wrote: >> clamp() methods added to Math and StrictMath >> >> `int clamp(long, int, int)` is somewhat different, as it accepts a `long` >> value and safely clamps it to an `int` range. Other overloads work with a >> particular type (long, float a

Re: RFR: 8301226: Add clamp() methods to java.lang.Math and to StrictMath [v8]

2023-02-14 Thread Karl T
On Tue, 14 Feb 2023 20:13:03 GMT, Tagir F. Valeev wrote: > Finally, I find it extremely strange to use var to hide the type and name the > variable as `longValue2`, encoding the type inside variable name. This is just an example name to document the type of the var for this post. 😉 ---

Re: RFR: 8301226: Add clamp() methods to java.lang.Math and to StrictMath [v8]

2023-02-14 Thread Karl T
On Tue, 7 Feb 2023 12:53:25 GMT, Tagir F. Valeev wrote: >> clamp() methods added to Math and StrictMath >> >> `int clamp(long, int, int)` is somewhat different, as it accepts a `long` >> value and safely clamps it to an `int` range. Other overloads work with a >> particular type (long, float a