Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-43034

Special values handling is inconsistent in DoubleDoubleSummation

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v4.2, v4.0, v3.6
    • Steps To Reproduce:
      Hide

      TEST(Summation, ConvertSpecialToDecimal) {
          constexpr double infinity = std::numeric_limits<double>::infinity();
          DoubleDoubleSummation sum;
          
          sum.addDouble(infinity);    
          ASSERT_EQUALS(infinity, sum.getDouble()); // ok
          ASSERT_TRUE(sum.getDecimal().isInfinite()); // <-- fail here, it's nan
          ASSERT_FALSE(sum.getDecimal().isNaN()); // <!-- fail here, it is actually nan
          
          sum.addDouble(1); // now once we add something to sum, everything is ok
          ASSERT_EQUALS(infinity, sum.getDouble()); // ok, still infinity
          ASSERT_TRUE(sum.getDecimal().isInfinite()); // ok, now it's infinity
          ASSERT_FALSE(sum.getDecimal().isNaN()); // ok, not nan
      }
      

      Show
      TEST(Summation, ConvertSpecialToDecimal) { constexpr double infinity = std::numeric_limits< double >::infinity(); DoubleDoubleSummation sum; sum.addDouble(infinity); ASSERT_EQUALS(infinity, sum.getDouble()); // ok ASSERT_TRUE(sum.getDecimal().isInfinite()); // <-- fail here, it's nan ASSERT_FALSE(sum.getDecimal().isNaN()); // <!-- fail here, it is actually nan sum.addDouble( 1 ); // now once we add something to sum, everything is ok ASSERT_EQUALS(infinity, sum.getDouble()); // ok, still infinity ASSERT_TRUE(sum.getDecimal().isInfinite()); // ok, now it's infinity ASSERT_FALSE(sum.getDecimal().isNaN()); // ok, not nan }
    • Sprint:
      Execution Team 2019-10-07
    • Linked BF Score:
      12

      Description

      If the result of DoubleDoubleSummation is Infinity, it may return different special values depending on whether the result is converted to double or decimal.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: