Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/boost/decimal/decimal128_fast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1370,7 +1370,7 @@ constexpr auto scalblnd128f(decimal128_fast num, long exp) noexcept -> decimal12
}
#endif

num.exponent_ = static_cast<decimal128_fast::exponent_type>(static_cast<long>(num.biased_exponent()) + exp);
num = decimal128_fast(num.significand_, num.biased_exponent() + exp, num.sign_);

return num;
}
Expand Down
1 change: 1 addition & 0 deletions test/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ run github_issue_448.cpp ;
run-fail github_issue_519.cpp ;
run github_issue_799.cpp ;
run github_issue_802.cpp ;
run github_issue_805.cpp ;
run link_1.cpp link_2.cpp link_3.cpp ;
run quick.cpp ;
run random_decimal32_comp.cpp ;
Expand Down
31 changes: 31 additions & 0 deletions test/github_issue_805.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright 2025 Matt Borland
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt

#include <boost/decimal.hpp>
#include <boost/core/lightweight_test.hpp>
#include <iostream>

using namespace boost::decimal;

template <typename Dec>
void test()
{
Dec a(2, std::numeric_limits<Dec>::max_exponent10);
Dec b = scalbln(a, 10);

BOOST_TEST(isinf(b));
}

int main()
{
test<decimal32>();
test<decimal64>();
test<decimal128>();
test<decimal32_fast>();
test<decimal64_fast>();
test<decimal128_fast>();

return boost::report_errors();
}

Loading