-
Type:
Improvement
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
Fully Compatible
-
v4.2, v4.0, v3.6
-
None
-
None
-
None
-
None
-
None
-
None
-
None
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
}
- is testing
-
SERVER-43034 Special values handling is inconsistent in DoubleDoubleSummation
-
- Closed
-