Skip to content

Commit 41d1c3c

Browse files
committed
Fix non-finite values and limits traps
1 parent 0168080 commit 41d1c3c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

include/boost/decimal/decimal32_fast.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ namespace decimal {
2929

3030
namespace detail {
3131

32-
BOOST_DECIMAL_CONSTEXPR_VARIABLE auto d32_fast_inf = std::numeric_limits<std::uint_fast32_t>::max() - 3;
33-
BOOST_DECIMAL_CONSTEXPR_VARIABLE auto d32_fast_qnan = std::numeric_limits<std::uint_fast32_t>::max() - 2;
34-
BOOST_DECIMAL_CONSTEXPR_VARIABLE auto d32_fast_snan = std::numeric_limits<std::uint_fast32_t>::max() - 1;
32+
BOOST_DECIMAL_CONSTEXPR_VARIABLE auto d32_fast_inf = std::numeric_limits<std::uint32_t>::max() - 3;
33+
BOOST_DECIMAL_CONSTEXPR_VARIABLE auto d32_fast_qnan = std::numeric_limits<std::uint32_t>::max() - 2;
34+
BOOST_DECIMAL_CONSTEXPR_VARIABLE auto d32_fast_snan = std::numeric_limits<std::uint32_t>::max() - 1;
3535

3636
}
3737

@@ -348,7 +348,7 @@ BOOST_DECIMAL_EXPORT class decimal_fast32_t final
348348
template <BOOST_DECIMAL_DECIMAL_FLOATING_TYPE Decimal, std::enable_if_t<detail::is_decimal_floating_point_v<Decimal> && (detail::decimal_val_v<Decimal> <= detail::decimal_val_v<decimal_fast32_t>), bool> = true>
349349
explicit constexpr operator Decimal() const noexcept;
350350

351-
friend constexpr auto direct_init(std::uint_fast32_t significand, std::uint_fast8_t exponent, bool sign) noexcept -> decimal_fast32_t;
351+
friend constexpr auto direct_init(significand_type significand, exponent_type exponent, bool sign) noexcept -> decimal_fast32_t;
352352
friend constexpr auto direct_init(const detail::decimal_fast32_t_components& x) noexcept -> decimal_fast32_t;
353353

354354
// <cmath> or extensions that need to be friends
@@ -452,7 +452,7 @@ BOOST_DECIMAL_CXX20_CONSTEXPR decimal_fast32_t::decimal_fast32_t(Float val) noex
452452
# pragma GCC diagnostic pop
453453
#endif
454454

455-
constexpr auto direct_init(std::uint_fast32_t significand, std::uint_fast8_t exponent, bool sign = false) noexcept -> decimal_fast32_t
455+
constexpr auto direct_init(const decimal_fast32_t::significand_type significand, const decimal_fast32_t::exponent_type exponent, const bool sign = false) noexcept -> decimal_fast32_t
456456
{
457457
decimal_fast32_t val;
458458
val.significand_ = significand;
@@ -1474,7 +1474,7 @@ struct numeric_limits<boost::decimal::decimal_fast32_t>
14741474
static constexpr int min_exponent10 = min_exponent;
14751475
static constexpr int max_exponent = 96;
14761476
static constexpr int max_exponent10 = max_exponent;
1477-
static constexpr bool traps = numeric_limits<std::uint_fast32_t>::traps;
1477+
static constexpr bool traps = numeric_limits<std::uint32_t>::traps;
14781478
static constexpr bool tinyness_before = true;
14791479

14801480
// Member functions

0 commit comments

Comments
 (0)