You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by GitBox <gi...@apache.org> on 2021/03/01 01:02:36 UTC

[GitHub] [groovy] paulk-asert commented on pull request #1504: Fix GROOVY-9797: println(-0.0f) does not comply with IEEE754

paulk-asert commented on pull request #1504:
URL: https://github.com/apache/groovy/pull/1504#issuecomment-787568244


   The `==` operator is deemed to have _business friendly_ behavior. Equating `==` with `equals` is an over simplification. For comparable objects, comparator logic is used and `NumberAwareComparator` would become relevant for the cases mentioned here. This falls into the same category as when we compare different number types:
   ```
   assert [false, true, 0] == [0.0f.equals(0.0d), 0.0f == 0.0d, new NumberAwareComparator().compare(0.0f, 0.0d)]
   ```
   In summary, this PR looks good but I think Groovy 4 only because of the breaking change.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org