Dear Core-Libs Dev Team,

I hope this message finds you well.

I would like to propose an enhancement to the Math class to extend the
Math.min and Math.max methods to support multiple parameters using varargs.
This enhancement aims to improve code readability and provide a more
intuitive way to find the minimum or maximum value among multiple numbers
without requiring nested calls or external logic.

Motivation:
Currently, developers must either nest multiple calls to Math.min or use
the Streams API (Arrays.stream(values).min()), which can feel cumbersome
for simple cases. By introducing varargs-based Math.min and Math.max methods
for int, long, float, and double, this proposal simplifies the process and
aligns with the expected functionality of these utility methods.

Current Progress:
I have submitted a pull request for this enhancement: PR #23138
<https://github.com/openjdk/jdk/pull/23138>. The PR includes:

   - Implementation of Math.min and Math.max with varargs for int, long,
   float, and double.

Feedback and Next Steps:
I am reaching out to gather your feedback on this proposal and determine
whether this enhancement aligns with the goals of the core-libs. I
understand that significant changes like this may require a CSR, and I am
fully prepared to follow the process once I have a response from the
community.

Thank you for your time and consideration. I look forward to hearing your
thoughts and engaging with the community on this proposal.

Best regards,

Aviad Zer

Reply via email to