Skip to content

Commit 5d1bd64

Browse files
committed
Add expanded reproducer
1 parent 4d0c7e2 commit 5d1bd64

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/test_literals.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,18 @@ void construct_negative_infinity()
132132
BOOST_TEST_EQ("-inf"_DLF, -"inf"_DLF);
133133
}
134134

135+
void test_issue_1119()
136+
{
137+
using namespace boost::decimal::literals;
138+
139+
const auto val = 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000_DD;
140+
BOOST_TEST_EQ(val, decimal64_t(1, 198));
141+
142+
const auto overflow_val = 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000_df;
143+
BOOST_TEST(isinf(overflow_val));
144+
BOOST_TEST(!signbit(overflow_val));
145+
}
146+
135147
int main()
136148
{
137149
test_decimal32_t_literals();
@@ -144,5 +156,7 @@ int main()
144156

145157
construct_negative_infinity();
146158

159+
test_issue_1119();
160+
147161
return boost::report_errors();
148162
}

0 commit comments

Comments
 (0)