Skip to content

Commit ade8ea0

Browse files
committed
Fix more naked usage of fast types instead of typedefs
1 parent 339a3ee commit ade8ea0

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
@@ -326,7 +326,7 @@ BOOST_DECIMAL_EXPORT class decimal32_fast final
326326
template <BOOST_DECIMAL_DECIMAL_FLOATING_TYPE Decimal, std::enable_if_t<detail::is_decimal_floating_point_v<Decimal> && (detail::impl::decimal_val_v<Decimal> <= detail::impl::decimal_val_v<decimal32_fast>), bool> = true>
327327
explicit constexpr operator Decimal() const noexcept;
328328

329-
friend constexpr auto direct_init(std::uint_fast32_t significand, std::uint_fast8_t exponent, bool sign) noexcept -> decimal32_fast;
329+
friend constexpr auto direct_init(significand_type significand, exponent_type exponent, bool sign) noexcept -> decimal32_fast;
330330

331331
// <cmath> or extensions that need to be friends
332332
template <BOOST_DECIMAL_DECIMAL_FLOATING_TYPE T>
@@ -379,7 +379,7 @@ constexpr decimal32_fast::decimal32_fast(T1 coeff, T2 exp, bool sign) noexcept
379379
exp = 0;
380380
}
381381

382-
auto biased_exp {static_cast<std::uint_fast32_t>(exp + detail::bias)};
382+
auto biased_exp {static_cast<exponent_type>(exp + detail::bias)};
383383

384384
// Decimal32 exponent holds 8 bits
385385
if (biased_exp > detail::max_biased_exp_v<decimal32_fast>)
@@ -431,7 +431,7 @@ BOOST_DECIMAL_CXX20_CONSTEXPR decimal32_fast::decimal32_fast(Float val) noexcept
431431
# pragma GCC diagnostic pop
432432
#endif
433433

434-
constexpr auto direct_init(std::uint_fast32_t significand, std::uint_fast8_t exponent, bool sign = false) noexcept -> decimal32_fast
434+
constexpr auto direct_init(decimal32_fast::significand_type significand, decimal32_fast::exponent_type exponent, bool sign = false) noexcept -> decimal32_fast
435435
{
436436
decimal32_fast val;
437437
val.significand_ = significand;
@@ -1030,8 +1030,8 @@ constexpr auto div_impl(decimal32_fast lhs, decimal32_fast rhs, decimal32_fast&
10301030

10311031
// We promote to uint64 since the significands are currently 32-bits
10321032
// By appending enough zeros to the LHS we end up finding what we need anyway
1033-
const auto big_sig_lhs {static_cast<std::uint_fast64_t>(lhs.significand_) * detail::pow10(static_cast<std::uint_fast64_t>(detail::precision_v<decimal32>))};
1034-
const auto res_sig {big_sig_lhs / static_cast<std::uint_fast64_t>(rhs.significand_)};
1033+
const auto big_sig_lhs {static_cast<decimal32_fast::significand_type>(lhs.significand_) * detail::pow10(static_cast<decimal32_fast::significand_type>(detail::precision_v<decimal32>))};
1034+
const auto res_sig {big_sig_lhs / static_cast<decimal32_fast::significand_type>(rhs.significand_)};
10351035
const auto res_exp {(lhs.biased_exponent() - detail::precision_v<decimal32>) - rhs.biased_exponent()};
10361036

10371037
q = decimal32_fast(res_sig, res_exp, lhs.sign_ != rhs.sign_);
@@ -1499,7 +1499,7 @@ struct numeric_limits<boost::decimal::decimal32_fast>
14991499
static constexpr int min_exponent10 = min_exponent;
15001500
static constexpr int max_exponent = 96;
15011501
static constexpr int max_exponent10 = max_exponent;
1502-
static constexpr bool traps = numeric_limits<std::uint_fast32_t>::traps;
1502+
static constexpr bool traps = numeric_limits<std::uint32_t>::traps;
15031503
static constexpr bool tinyness_before = true;
15041504

15051505
// Member functions

0 commit comments

Comments
 (0)