RFR: JDK-8348030 : Extend Math.min and Math.max to support multiple parameters [v2]

Aviad Zer duke at openjdk.org
Mon Jan 20 12:54:36 UTC 2025


On Mon, 20 Jan 2025 11:43:13 GMT, Aviad Zer <duke at openjdk.org> wrote:

>> 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

> Before dealing with a CSR, I suggest you socialize your idea/PR in the [core-libs-dev at openjdk.org](mailto:core-libs-dev at openjdk.org) mailing list. You could reference this PR in the initial mail.

Thanks for help, I'll do that

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

PR Comment: https://git.openjdk.org/jdk/pull/23138#issuecomment-2602350853


More information about the core-libs-dev mailing list