Skip to content

Commit e1975ab

Browse files
committed
Test next after max sig
1 parent 344d6d3 commit e1975ab

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/github_issue_1105.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ void test()
3636
BOOST_TEST_EQ(prev_exp, val_exp - 1);
3737
BOOST_TEST_EQ(prev_sig, detail::max_significand_v<T>);
3838

39+
// Max significand + 1 should be reduced
40+
const auto original_val {nextafter(prev, one)};
41+
int original_exp {};
42+
const auto original_sig {frexp10(original_val, &original_exp)};
43+
BOOST_TEST_EQ(original_exp, val_exp);
44+
BOOST_TEST_EQ(original_sig, val_sig);
45+
3946
const auto zero_next {nextafter(zero, one)};
4047
BOOST_TEST_EQ(zero_next, std::numeric_limits<T>::denorm_min());
4148

0 commit comments

Comments
 (0)