alhudz opened a new pull request, #1733:
URL: https://github.com/apache/commons-lang/pull/1733

   `Repro`: `NumberUtils.max(-0.0d, 0.0d)` returns `-0.0` (so `1 / result` is 
`-Infinity`); `NumberUtils.min(0.0d, -0.0d)` returns `0.0`.
   
   `Cause`: the `double`/`float` varargs overloads pick the extreme with 
`<`/`>`, which rank `-0.0` and `0.0` as equal, so the sign held in the 
accumulator survives. `Math.max`/`Math.min`, the three-argument `min`/`max` 
overloads and `IEEE754rUtils` all return the other sign for these inputs.
   
   `Fix`: run the loop through `Math.max`/`Math.min` in the four 
`double`/`float` overloads, matching the three-argument versions. Those also 
propagate `NaN`, so the explicit `isNaN` check is no longer needed and the 
existing `NaN` results stay the same.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to