RFR: JDK-8348030 : Extend Math.min and Math.max to support multiple parameters [v2]
Aviad Zer
duke at openjdk.org
Mon Jan 20 11:43:13 UTC 2025
> This change extends the Math.min function to support multiple parameters, improving its usability and code readability.
>
> Previously, finding the minimum value among multiple variables required using nested Math.min calls or converting the variables into an array and iterating through it. This enhancement provides a more intuitive and straightforward approach to achieve the same result.
>
> Benefits:
>
> Simplifies code by eliminating the need for nested Math.min calls.
> Enhances readability, especially when comparing multiple values.
> Offers consistency with existing Math.min usage patterns.
Aviad Zer has updated the pull request incrementally with one additional commit since the last revision:
Update Math.java by adding extended max function
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/23138/files
- new: https://git.openjdk.org/jdk/pull/23138/files/be5728d8..3e333ee6
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=23138&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=23138&range=00-01
Stats: 71 lines in 1 file changed: 71 ins; 0 del; 0 mod
Patch: https://git.openjdk.org/jdk/pull/23138.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/23138/head:pull/23138
PR: https://git.openjdk.org/jdk/pull/23138
More information about the core-libs-dev
mailing list