[ 
https://issues.apache.org/jira/browse/GROOVY-12538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18132855#comment-18132855
 ] 

ASF GitHub Bot commented on GROOVY-12538:
-----------------------------------------

codecov-commenter commented on PR #3053:
URL: https://github.com/apache/groovy/pull/3053#issuecomment-6441349590

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3053?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 Report
   :x: Patch coverage is `80.00000%` with `1 line` in your changes missing 
coverage. Please review.
   :white_check_mark: Project coverage is 73.6092%. Comparing base 
([`7be8da0`](https://app.codecov.io/gh/apache/groovy/commit/7be8da046fd57a35ef4bdc7ba93cfcda163025bd?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`738c4ed`](https://app.codecov.io/gh/apache/groovy/commit/738c4ede0687a70b5d54b7c0e5e8a6e51e78eff5?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 2 commits behind head on master.
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3053?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Patch % | Lines |
   |---|---|---|
   | 
[...oovy/classgen/asm/BinaryFloatExpressionHelper.java](https://app.codecov.io/gh/apache/groovy/pull/3053?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2FBinaryFloatExpressionHelper.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9CaW5hcnlGbG9hdEV4cHJlc3Npb25IZWxwZXIuamF2YQ==)
 | 0.0000% | [1 Missing :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/3053?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   [![Impacted file tree 
graph](https://app.codecov.io/gh/apache/groovy/pull/3053/graphs/tree.svg?width=650&height=150&src=pr&token=1r45138NfQ&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/groovy/pull/3053?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #3053        +/-   ##
   ==================================================
   + Coverage     73.6037%   73.6092%   +0.0055%     
   - Complexity      42344      42354        +10     
   ==================================================
     Files            1657       1657                
     Lines          145706     145710         +4     
     Branches        27497      27497                
   ==================================================
   + Hits           107245     107256        +11     
   + Misses          28480      28479         -1     
   + Partials         9981       9975         -6     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3053?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[...ovy/classgen/asm/BinaryDoubleExpressionHelper.java](https://app.codecov.io/gh/apache/groovy/pull/3053?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2FBinaryDoubleExpressionHelper.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9CaW5hcnlEb3VibGVFeHByZXNzaW9uSGVscGVyLmphdmE=)
 | `52.1739% <100.0000%> (-2.3715%)` | :arrow_down: |
   | 
[...us/groovy/classgen/asm/BinaryExpressionWriter.java](https://app.codecov.io/gh/apache/groovy/pull/3053?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2FBinaryExpressionWriter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9CaW5hcnlFeHByZXNzaW9uV3JpdGVyLmphdmE=)
 | `63.0000% <100.0000%> (+0.7551%)` | :arrow_up: |
   | 
[...oovy/classgen/asm/BinaryFloatExpressionHelper.java](https://app.codecov.io/gh/apache/groovy/pull/3053?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2FBinaryFloatExpressionHelper.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9CaW5hcnlGbG9hdEV4cHJlc3Npb25IZWxwZXIuamF2YQ==)
 | `23.0769% <0.0000%> (-0.9231%)` | :arrow_down: |
   
   ... and [9 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/3053/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   </details>
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test 
Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, 
report on failures, and find test suite problems.
   - :package: [JS Bundle 
Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save 
yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>




> Primitive double/float > and >= comparisons return true when an operand is NaN
> ------------------------------------------------------------------------------
>
>                 Key: GROOVY-12538
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12538
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Paul King
>            Priority: Major
>
> Description:
> When both operands of a comparison are primitive double (or float) values, 
> Groovy
> compiles the comparison to a DCMPG (FCMPG) instruction for all four ordered 
> operators.
> DCMPG pushes 1 when either operand is NaN, so > and >= evaluate to true; 
> javac uses
> DCMPL (FCMPL) for > and >= and DCMPG (FCMPG) for < and <=, so that every 
> comparison
> with a NaN operand is false (JLS 15.20.1).
> {code:groovy}
> double n = Double.NaN
> assert !(n > 0.0d)    // fails: true
> assert !(n >= 0.0d)   // fails: true
> assert !(n < 0.0d)    // passes
> assert !(n <= 0.0d)   // passes
> float f = Float.NaN
> assert !(f > 0.0f)    // fails: true
> {code}
> It affects local variables, fields, static fields and parameters declared 
> double or
> float, in dynamic code as well as under @TypeChecked and @CompileStatic. Under
> @CompileStatic it also affects Double.NaN itself, which is a primitive there:
> Double.NaN > 0.0d is false in dynamic code (the field value is boxed) and 
> true under
> @CompileStatic.
> Groovy is also inconsistent with itself: for two Double objects, n > 0.0d 
> already
> gives false, because the runtime unboxes and uses Java's operator.
> Cause: BinaryDoubleExpressionHelper.getCompareCode() returns DCMPG and
> BinaryFloatExpressionHelper.getCompareCode() returns FCMPG for every operator
> (since the primitive-optimisation backends were added in 2011).
> This is narrower than GROOVY-3309, which asks for NaN comparisons through 
> Groovy's
> number comparison (mixed types, ==) to follow IEEE 754 as well. Those paths 
> follow
> Double.compareTo/Double.equals by design and are not changed here; <=> already
> matches Double.compare for primitives.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to