RFR: JDK-8348030 : Extend Math.min to support multiple parameters

Aviad Zer duke at openjdk.org
Sat Jan 18 12:40:08 UTC 2025


On Wed, 15 Jan 2025 14:26:32 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.

updating the commit message with relevant BUG-ID

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

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


More information about the core-libs-dev mailing list