daniellansun opened a new pull request, #3334:
URL: https://github.com/apache/groovy/pull/3334

   https://issues.apache.org/jira/browse/GROOVY-3309
   
   Boolean comparisons that go through `ScriptBytecodeAdapter` (`==`, `!=`, 
`<`, `<=`, `>`, `>=`) are now false when one operand is a `Double` or `Float` 
NaN and the other is numeric. That includes a NaN compared with itself, and 
mixed types such as `Double.NaN > 0`. It matches a primitive `double` or 
`float` (JLS 15.20.1 / 15.21.1) and the primitive comparisons fixed in 
GROOVY-12538.
   
   This is a Groovy 7 behavioral change and should not be backported to 6.0.x. 
Code that used `value == Double.NaN` or `x != x` on a boxed NaN should use 
`Double.isNaN` or `Float.isNaN` instead.
   
   `<=>` is unchanged and still follows `Double.compare`. `is` / `===`, Groovy 
truth, and `equals` / `in` / `switch` / `List.contains` are also unchanged. 
Because this is a runtime helper change, already-compiled classes pick it up 
without recompilation.
   
   `testGroovy3309` now runs as a regular test; its assertions are unchanged. 
Additional coverage is in `Groovy3309`.


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