Skip to content

Commit d0f6bf5

Browse files
committed
Add test against add/sub of zero with downwards rounding
1 parent b6ef45f commit d0f6bf5

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/test_downward_rounding.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,23 @@ int main()
7878
test_sub<decimal_fast128_t>("1e+2", "1e-383", "99.99999999999999999999999999999999");
7979
test_sub<decimal_fast128_t>("1e+1", "1e-383", "9.999999999999999999999999999999999");
8080

81+
test_add<decimal32_t>("9.999999e20", "0", "9.999999e20");
82+
test_add<decimal_fast32_t>("9.999999e20", "0", "9.999999e20");
83+
84+
test_sub<decimal32_t>("9.999999e20", "0", "9.999999e20");
85+
test_sub<decimal_fast32_t>("9.999999e20", "0", "9.999999e20");
86+
87+
test_add<decimal64_t>("9.999999999999999e200", "0", "9.999999999999999e200");
88+
test_add<decimal_fast64_t>("9.999999999999999e200", "0", "9.999999999999999e200");
89+
90+
test_sub<decimal64_t>("9.999999999999999e200", "0", "9.999999999999999e200");
91+
test_sub<decimal_fast64_t>("9.999999999999999e200", "0", "9.999999999999999e200");
92+
93+
test_add<decimal128_t>("9.999999999999999e200", "0", "9.999999999999999e200");
94+
test_add<decimal_fast128_t>("9.999999999999999e200", "0", "9.999999999999999e200");
95+
96+
test_sub<decimal128_t>("9.999999999999999e200", "0", "9.999999999999999e200");
97+
test_sub<decimal_fast128_t>("9.999999999999999e200", "0", "9.999999999999999e200");
98+
8199
return boost::report_errors();
82100
}

0 commit comments

Comments
 (0)