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

Tagir F. Valeev tvaleev at openjdk.org
Mon Feb 6 08:46:55 UTC 2023


On Mon, 6 Feb 2023 03:25:50 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

>> No. I want NaNs to go into this branch
>
> @amaembo Should that be `if (!(min <= max))` instead?

@merykitty no. I want `min = +0.0` and `max = -0.0` to go into this branch, so we can report it. A marginal case when `min` and `max` are exactly equal goes through all the checks and still succeeds (it's covered by unit-tests).

-------------

PR: https://git.openjdk.org/jdk/pull/12428


More information about the core-libs-dev mailing list