Skip to content

Commit 84ee07e

Browse files
authored
Merge pull request #1225 from cppalliance/1189
Replace sign boolean in constructor with an enum class
2 parents 8fe595f + 0b2ca35 commit 84ee07e

File tree

15 files changed

+210
-134
lines changed

15 files changed

+210
-134
lines changed

doc/modules/ROOT/pages/basics.adoc

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,33 @@ Every decimal type can be constructed in a few ways:
1616

1717
[source, c++]
1818
----
19+
namespace boost {
20+
namespace decimal {
21+
22+
enum class construction_sign
23+
{
24+
negative,
25+
positive
26+
};
27+
1928
template <typename UnsignedInteger, typename Integer>
20-
constexpr decimal32_t(UnsignedInteger coefficient, Integer exponent, bool is_negative = false) noexcept;
29+
constexpr decimal32_t(UnsignedInteger coefficient, Integer exponent, construction_sign resultant_sign = construction_sign::positive) noexcept;
2130
2231
template <typename SignedInteger, typename Integer>
2332
constexpr decimal32_t(SignedInteger coefficient, Integer exponent) noexcept;
33+
34+
} // namespace decimal
35+
} // namespace boost
2436
----
2537

2638
As you can see you are either allowed to pass a signed integer, or specify the signedness of the resulting number, but not both.
27-
This is designed to reduce confusion (e.g. what would be the resulting sign of `{-3, 0, true}`?)
39+
This is designed to reduce confusion (e.g. what would be the resulting sign of `{-3, 0, construction_sign::negative}`?)
2840

2941
[souce, c++]
3042
----
3143
boost::decimal::decimal32_t a {1, 1}; // constructs 1e1 = 10
3244
boost::decimal::decimal32_t b {-2, -1}; // constructs -2e-2 or -0.2
33-
boost::decimal::decimal32_t c {2U, -1, true}; // also constructs -2e-1 or -0.2 (Note: The coefficient must be an unsigned type)
45+
boost::decimal::decimal32_t c {2U, -1, construction_sign::negative}; // also constructs -2e-1 or -0.2 (Note: The coefficient must be an unsigned type)
3446
boost::decimal::decimal32_t e {5, 5}; // constructs 5x10^5
3547
boost::decimal::decimal32_t f {1234, -3} // constructs 1.234 or 1234x10^-3
3648
----

doc/modules/ROOT/pages/examples.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ int main()
2626
2727
std::cout << sum << std::endl; // prints 0.3
2828
29-
const boost::decimal::decimal32_t neg_a {2, -1, true}; // Constructs the number -0.2
29+
const boost::decimal::decimal32_t neg_a {2, -1, construction_sign::negative}; // Constructs the number -0.2
3030
3131
sum += neg_a;
3232

examples/basic_construction.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,23 @@
22
// Distributed under the Boost Software License, Version 1.0.
33
// https://www.boost.org/LICENSE_1_0.txt
44

5-
#include <boost/decimal.hpp>
5+
#include <boost/decimal/decimal32_t.hpp>
6+
#include <boost/decimal/decimal64_t.hpp>
7+
#include <boost/decimal/iostream.hpp>
68
#include <iostream>
79
#include <iomanip>
810

911
int main()
1012
{
11-
using namespace boost::decimal;
13+
using boost::decimal::decimal32_t;
14+
using boost::decimal::decimal64_t;
15+
using boost::decimal::construction_sign;
16+
using boost::decimal::isinf;
17+
using boost::decimal::isnan;
1218

1319
constexpr decimal32_t val_1 {100}; // Construction from an integer
1420
constexpr decimal32_t val_2 {10, 1}; // Construction from a signed integer and exponent
15-
constexpr decimal32_t val_3 {1U, 2, false}; // Construction from an unsigned integer, exponent, and sign
21+
constexpr decimal32_t val_3 {1U, 2, construction_sign::negative}; // Construction from an unsigned integer, exponent, and sign
1622

1723
std::cout << "Val_1: " << val_1 << '\n'
1824
<< "Val_2: " << val_2 << '\n'

include/boost/decimal/decimal128_t.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include <boost/decimal/detail/chars_format.hpp>
4141
#include <boost/decimal/detail/components.hpp>
4242
#include <boost/decimal/detail/from_string.hpp>
43+
#include <boost/decimal/detail/construction_sign.hpp>
4344

4445
#ifndef BOOST_DECIMAL_BUILD_MODULE
4546

@@ -272,7 +273,7 @@ BOOST_DECIMAL_EXPORT class decimal128_t final
272273
#else
273274
template <typename T1, typename T2, std::enable_if_t<detail::is_unsigned_v<T1> && detail::is_integral_v<T2>, bool> = true>
274275
#endif
275-
constexpr decimal128_t(T1 coeff, T2 exp, bool is_negative = false) noexcept;
276+
constexpr decimal128_t(T1 coeff, T2 exp, detail::construction_sign_wrapper resultant_sign = construction_sign::positive) noexcept;
276277

277278
#ifdef BOOST_DECIMAL_HAS_CONCEPTS
278279
template <BOOST_DECIMAL_SIGNED_INTEGRAL T1, BOOST_DECIMAL_INTEGRAL T2>
@@ -730,8 +731,9 @@ template <BOOST_DECIMAL_UNSIGNED_INTEGRAL T1, BOOST_DECIMAL_INTEGRAL T2>
730731
#else
731732
template <typename T1, typename T2, std::enable_if_t<detail::is_unsigned_v<T1> && detail::is_integral_v<T2>, bool>>
732733
#endif
733-
constexpr decimal128_t::decimal128_t(T1 coeff, T2 exp, bool is_negative) noexcept
734+
constexpr decimal128_t::decimal128_t(T1 coeff, T2 exp, const detail::construction_sign_wrapper resultant_sign) noexcept
734735
{
736+
const auto is_negative {static_cast<bool>(resultant_sign)};
735737
bits_.high = is_negative ? detail::d128_sign_mask : UINT64_C(0);
736738

737739
// If the coeff is not in range make it so
@@ -2254,7 +2256,7 @@ class numeric_limits_impl128
22542256
// Member functions
22552257
static constexpr auto (min) () -> boost::decimal::decimal128_t { return {UINT32_C(1), min_exponent}; }
22562258
static constexpr auto (max) () -> boost::decimal::decimal128_t { return {boost::int128::uint128_t{UINT64_C(0b1111011010000100110111110101011011000011111000000), UINT64_C(0b0011011110001101100011100110001111111111111111111111111111111111)}, max_exponent - digits + 1}; }
2257-
static constexpr auto lowest () -> boost::decimal::decimal128_t { return {boost::int128::uint128_t{UINT64_C(0b1111011010000100110111110101011011000011111000000), UINT64_C(0b0011011110001101100011100110001111111111111111111111111111111111)}, max_exponent - digits + 1, true}; }
2259+
static constexpr auto lowest () -> boost::decimal::decimal128_t { return {boost::int128::uint128_t{UINT64_C(0b1111011010000100110111110101011011000011111000000), UINT64_C(0b0011011110001101100011100110001111111111111111111111111111111111)}, max_exponent - digits + 1, construction_sign::negative}; }
22582260
static constexpr auto epsilon () -> boost::decimal::decimal128_t { return {UINT32_C(1), -digits + 1}; }
22592261
static constexpr auto round_error () -> boost::decimal::decimal128_t { return epsilon(); }
22602262
static constexpr auto infinity () -> boost::decimal::decimal128_t { return boost::decimal::from_bits(boost::decimal::detail::d128_inf_mask); }

include/boost/decimal/decimal32_t.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include <boost/decimal/detail/to_chars_result.hpp>
4242
#include <boost/decimal/detail/chars_format.hpp>
4343
#include <boost/decimal/detail/from_string.hpp>
44+
#include <boost/decimal/detail/construction_sign.hpp>
4445

4546
#ifndef BOOST_DECIMAL_BUILD_MODULE
4647

@@ -297,7 +298,7 @@ BOOST_DECIMAL_EXPORT class decimal32_t final // NOLINT(cppcoreguidelines-special
297298
#else
298299
template <typename T1, typename T2, std::enable_if_t<detail::is_unsigned_v<T1> && detail::is_integral_v<T2>, bool> = true>
299300
#endif
300-
constexpr decimal32_t(T1 coeff, T2 exp, bool is_negative = false) noexcept;
301+
constexpr decimal32_t(T1 coeff, T2 exp, detail::construction_sign_wrapper resultant_sign = construction_sign::positive) noexcept;
301302

302303
#ifdef BOOST_DECIMAL_HAS_CONCEPTS
303304
template <BOOST_DECIMAL_SIGNED_INTEGRAL T1, BOOST_DECIMAL_INTEGRAL T2>
@@ -651,11 +652,12 @@ template <BOOST_DECIMAL_UNSIGNED_INTEGRAL T1, BOOST_DECIMAL_INTEGRAL T2>
651652
#else
652653
template <typename T1, typename T2, std::enable_if_t<detail::is_unsigned_v<T1> && detail::is_integral_v<T2>, bool>>
653654
#endif
654-
constexpr decimal32_t::decimal32_t(T1 coeff, T2 exp, bool is_negative) noexcept // NOLINT(readability-function-cognitive-complexity,misc-no-recursion)
655+
constexpr decimal32_t::decimal32_t(T1 coeff, T2 exp, const detail::construction_sign_wrapper resultant_sign) noexcept // NOLINT(readability-function-cognitive-complexity,misc-no-recursion)
655656
{
656657
static_assert(detail::is_integral_v<T1>, "Coefficient must be an integer");
657658
static_assert(detail::is_integral_v<T2>, "Exponent must be an integer");
658659

660+
const auto is_negative {static_cast<bool>(resultant_sign)};
659661
bits_ = is_negative ? detail::d32_sign_mask : UINT32_C(0);
660662

661663
// If the coeff is not in range, make it so
@@ -2322,7 +2324,7 @@ class numeric_limits_impl32
23222324
// Member functions
23232325
static constexpr auto (min) () -> boost::decimal::decimal32_t { return {UINT32_C(1), min_exponent}; }
23242326
static constexpr auto (max) () -> boost::decimal::decimal32_t { return {boost::decimal::detail::d32_max_significand_value, max_exponent - digits + 1}; }
2325-
static constexpr auto lowest () -> boost::decimal::decimal32_t { return {boost::decimal::detail::d32_max_significand_value, max_exponent - digits + 1, true}; }
2327+
static constexpr auto lowest () -> boost::decimal::decimal32_t { return {boost::decimal::detail::d32_max_significand_value, max_exponent - digits + 1, construction_sign::negative}; }
23262328
static constexpr auto epsilon () -> boost::decimal::decimal32_t { return {UINT32_C(1), -digits + 1}; }
23272329
static constexpr auto round_error () -> boost::decimal::decimal32_t { return epsilon(); }
23282330
static constexpr auto infinity () -> boost::decimal::decimal32_t { return boost::decimal::from_bits(boost::decimal::detail::d32_inf_mask); }

include/boost/decimal/decimal64_t.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include <boost/decimal/detail/chars_format.hpp>
4444
#include <boost/decimal/detail/to_chars_result.hpp>
4545
#include <boost/decimal/detail/from_string.hpp>
46+
#include <boost/decimal/detail/construction_sign.hpp>
4647

4748
#ifndef BOOST_DECIMAL_BUILD_MODULE
4849

@@ -335,7 +336,7 @@ BOOST_DECIMAL_EXPORT class decimal64_t final
335336
#else
336337
template <typename T1, typename T2, std::enable_if_t<detail::is_unsigned_v<T1> && detail::is_integral_v<T2>, bool> = true>
337338
#endif
338-
constexpr decimal64_t(T1 coeff, T2 exp, bool is_negative = false) noexcept;
339+
constexpr decimal64_t(T1 coeff, T2 exp, detail::construction_sign_wrapper resultant_sign = construction_sign::positive) noexcept;
339340

340341
#ifdef BOOST_DECIMAL_HAS_CONCEPTS
341342
template <BOOST_DECIMAL_SIGNED_INTEGRAL T1, BOOST_DECIMAL_INTEGRAL T2>
@@ -650,8 +651,9 @@ template <BOOST_DECIMAL_UNSIGNED_INTEGRAL T1, BOOST_DECIMAL_INTEGRAL T2>
650651
#else
651652
template <typename T1, typename T2, std::enable_if_t<detail::is_unsigned_v<T1> && detail::is_integral_v<T2>, bool>>
652653
#endif
653-
constexpr decimal64_t::decimal64_t(T1 coeff, T2 exp, bool is_negative) noexcept
654+
constexpr decimal64_t::decimal64_t(T1 coeff, T2 exp, const detail::construction_sign_wrapper resultant_sign) noexcept
654655
{
656+
const auto is_negative {static_cast<bool>(resultant_sign)};
655657
bits_ = is_negative ? detail::d64_sign_mask : UINT64_C(0);
656658

657659
// If the coeff is not in range, make it so
@@ -2231,7 +2233,7 @@ class numeric_limits_impl64
22312233
// Member functions
22322234
static constexpr auto (min) () -> boost::decimal::decimal64_t { return {UINT32_C(1), min_exponent}; }
22332235
static constexpr auto (max) () -> boost::decimal::decimal64_t { return {boost::decimal::detail::d64_max_significand_value, max_exponent - digits + 1}; }
2234-
static constexpr auto lowest () -> boost::decimal::decimal64_t { return {boost::decimal::detail::d64_max_significand_value, max_exponent - digits + 1, true}; }
2236+
static constexpr auto lowest () -> boost::decimal::decimal64_t { return {boost::decimal::detail::d64_max_significand_value, max_exponent - digits + 1, construction_sign::negative}; }
22352237
static constexpr auto epsilon () -> boost::decimal::decimal64_t { return {UINT32_C(1), -digits + 1}; }
22362238
static constexpr auto round_error () -> boost::decimal::decimal64_t { return epsilon(); }
22372239
static constexpr auto infinity () -> boost::decimal::decimal64_t { return boost::decimal::from_bits(boost::decimal::detail::d64_inf_mask); }

include/boost/decimal/decimal_fast128_t.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include <boost/decimal/detail/chars_format.hpp>
4141
#include <boost/decimal/detail/components.hpp>
4242
#include <boost/decimal/detail/from_string.hpp>
43+
#include <boost/decimal/detail/construction_sign.hpp>
4344

4445
#ifndef BOOST_DECIMAL_BUILD_MODULE
4546

@@ -215,7 +216,7 @@ BOOST_DECIMAL_EXPORT class decimal_fast128_t final
215216
#else
216217
template <typename T1, typename T2, std::enable_if_t<detail::is_unsigned_v<T1> && detail::is_integral_v<T2>, bool> = true>
217218
#endif
218-
constexpr decimal_fast128_t(T1 coeff, T2 exp, bool is_negative = false) noexcept;
219+
constexpr decimal_fast128_t(T1 coeff, T2 exp, detail::construction_sign_wrapper resultant_sign = construction_sign::positive) noexcept;
219220

220221
#ifdef BOOST_DECIMAL_HAS_CONCEPTS
221222
template <BOOST_DECIMAL_SIGNED_INTEGRAL T1, BOOST_DECIMAL_INTEGRAL T2>
@@ -489,12 +490,13 @@ template <BOOST_DECIMAL_UNSIGNED_INTEGRAL T1, BOOST_DECIMAL_INTEGRAL T2>
489490
#else
490491
template <typename T1, typename T2, std::enable_if_t<detail::is_unsigned_v<T1> && detail::is_integral_v<T2>, bool>>
491492
#endif
492-
constexpr decimal_fast128_t::decimal_fast128_t(T1 coeff, T2 exp, bool is_negative) noexcept
493+
constexpr decimal_fast128_t::decimal_fast128_t(T1 coeff, T2 exp, const detail::construction_sign_wrapper resultant_sign) noexcept
493494
{
494495
using minimum_coefficient_size = std::conditional_t<(sizeof(T1) > sizeof(significand_type)), T1, significand_type>;
495496

496497
minimum_coefficient_size min_coeff {coeff};
497498

499+
const auto is_negative {static_cast<bool>(resultant_sign)};
498500
sign_ = is_negative;
499501

500502
// Normalize the significand in the constructor, so we don't have
@@ -1616,7 +1618,7 @@ class numeric_limits_impl128f
16161618
// Member functions
16171619
static constexpr auto (min) () -> boost::decimal::decimal_fast128_t { return {UINT32_C(1), min_exponent}; }
16181620
static constexpr auto (max) () -> boost::decimal::decimal_fast128_t { return {boost::int128::uint128_t{UINT64_C(0b1111011010000100110111110101011011000011111000000), UINT64_C(0b0011011110001101100011100110001111111111111111111111111111111111)}, max_exponent - digits + 1}; }
1619-
static constexpr auto lowest () -> boost::decimal::decimal_fast128_t { return {boost::int128::uint128_t{UINT64_C(0b1111011010000100110111110101011011000011111000000), UINT64_C(0b0011011110001101100011100110001111111111111111111111111111111111)}, max_exponent - digits + 1, true}; }
1621+
static constexpr auto lowest () -> boost::decimal::decimal_fast128_t { return {boost::int128::uint128_t{UINT64_C(0b1111011010000100110111110101011011000011111000000), UINT64_C(0b0011011110001101100011100110001111111111111111111111111111111111)}, max_exponent - digits + 1, construction_sign::negative}; }
16201622
static constexpr auto epsilon () -> boost::decimal::decimal_fast128_t { return {UINT32_C(1), -digits + 1}; }
16211623
static constexpr auto round_error () -> boost::decimal::decimal_fast128_t { return epsilon(); }
16221624
static constexpr auto infinity () -> boost::decimal::decimal_fast128_t { return boost::decimal::direct_init_d128(boost::decimal::detail::d128_fast_inf, 0, false); }

include/boost/decimal/decimal_fast32_t.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include <boost/decimal/detail/to_chars_result.hpp>
4242
#include <boost/decimal/detail/chars_format.hpp>
4343
#include <boost/decimal/detail/from_string.hpp>
44+
#include <boost/decimal/detail/construction_sign.hpp>
4445

4546
#ifndef BOOST_DECIMAL_BUILD_MODULE
4647
#include <limits>
@@ -211,7 +212,7 @@ BOOST_DECIMAL_EXPORT class decimal_fast32_t final
211212
constexpr decimal_fast32_t() noexcept = default;
212213

213214
template <typename T1, typename T2, std::enable_if_t<detail::is_unsigned_v<T1> && detail::is_integral_v<T2>, bool> = true>
214-
constexpr decimal_fast32_t(T1 coeff, T2 exp, bool is_negative = false) noexcept;
215+
constexpr decimal_fast32_t(T1 coeff, T2 exp, detail::construction_sign_wrapper resultant_sign = construction_sign::positive) noexcept;
215216

216217
template <typename T1, typename T2, std::enable_if_t<!detail::is_unsigned_v<T1> && detail::is_integral_v<T2>, bool> = true>
217218
constexpr decimal_fast32_t(T1, T2, bool) noexcept { static_assert(detail::is_unsigned_v<T1>, "Construction from signed integer, exponent, and sign is ambiguous, so it is disallowed. You must use an Unsigned Integer for the coefficient to construct from {coefficient, exponent, sign}"); }
@@ -479,12 +480,13 @@ BOOST_DECIMAL_EXPORT class decimal_fast32_t final
479480
};
480481

481482
template <typename T1, typename T2, std::enable_if_t<detail::is_unsigned_v<T1> && detail::is_integral_v<T2>, bool>>
482-
constexpr decimal_fast32_t::decimal_fast32_t(T1 coeff, T2 exp, bool is_negative) noexcept
483+
constexpr decimal_fast32_t::decimal_fast32_t(T1 coeff, T2 exp, const detail::construction_sign_wrapper resultant_sign) noexcept
483484
{
484485
using minimum_coefficient_size = std::conditional_t<(sizeof(T1) > sizeof(significand_type)), T1, significand_type>;
485486

486487
minimum_coefficient_size min_coeff {coeff};
487488

489+
const auto is_negative {static_cast<bool>(resultant_sign)};
488490
sign_ = is_negative;
489491

490492
// Normalize in the constructor, so we never have to worry about it again
@@ -1578,7 +1580,7 @@ class numeric_limits_impl32f
15781580
// Member functions
15791581
static constexpr auto (min) () -> boost::decimal::decimal_fast32_t { return {UINT32_C(1), min_exponent}; }
15801582
static constexpr auto (max) () -> boost::decimal::decimal_fast32_t { return {UINT32_C(9'999'999), max_exponent - digits + 1}; }
1581-
static constexpr auto lowest () -> boost::decimal::decimal_fast32_t { return {UINT32_C(9'999'999), max_exponent - digits + 1, true}; }
1583+
static constexpr auto lowest () -> boost::decimal::decimal_fast32_t { return {UINT32_C(9'999'999), max_exponent - digits + 1, construction_sign::negative}; }
15821584
static constexpr auto epsilon () -> boost::decimal::decimal_fast32_t { return {UINT32_C(1), -digits + 1}; }
15831585
static constexpr auto round_error () -> boost::decimal::decimal_fast32_t { return epsilon(); }
15841586
static constexpr auto infinity () -> boost::decimal::decimal_fast32_t { return boost::decimal::direct_init(boost::decimal::detail::d32_fast_inf, UINT8_C((0))); }

include/boost/decimal/decimal_fast64_t.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include <boost/decimal/detail/to_chars_result.hpp>
4242
#include <boost/decimal/detail/chars_format.hpp>
4343
#include <boost/decimal/detail/from_string.hpp>
44+
#include <boost/decimal/detail/construction_sign.hpp>
4445

4546
#ifndef BOOST_DECIMAL_BUILD_MODULE
4647

@@ -222,7 +223,7 @@ BOOST_DECIMAL_EXPORT class decimal_fast64_t final
222223
#else
223224
template <typename T1, typename T2, std::enable_if_t<detail::is_unsigned_v<T1> && detail::is_integral_v<T2>, bool> = true>
224225
#endif
225-
constexpr decimal_fast64_t(T1 coeff, T2 exp, bool is_negative = false) noexcept;
226+
constexpr decimal_fast64_t(T1 coeff, T2 exp, detail::construction_sign_wrapper resultant_sign = construction_sign::positive) noexcept;
226227

227228
#ifdef BOOST_DECIMAL_HAS_CONCEPTS
228229
template <BOOST_DECIMAL_SIGNED_INTEGRAL T1, BOOST_DECIMAL_INTEGRAL T2>
@@ -484,12 +485,13 @@ template <BOOST_DECIMAL_UNSIGNED_INTEGRAL T1, BOOST_DECIMAL_INTEGRAL T2>
484485
#else
485486
template <typename T1, typename T2, std::enable_if_t<detail::is_unsigned_v<T1> && detail::is_integral_v<T2>, bool>>
486487
#endif
487-
constexpr decimal_fast64_t::decimal_fast64_t(T1 coeff, T2 exp, bool is_negative) noexcept
488+
constexpr decimal_fast64_t::decimal_fast64_t(T1 coeff, T2 exp, const detail::construction_sign_wrapper resultant_sign) noexcept
488489
{
489490
using minimum_coefficient_size = std::conditional_t<(sizeof(T1) > sizeof(significand_type)), T1, significand_type>;
490491

491492
minimum_coefficient_size min_coeff {coeff};
492493

494+
const auto is_negative {static_cast<bool>(resultant_sign)};
493495
sign_ = is_negative;
494496

495497
// Normalize the value, so we don't have to worry about it with operations
@@ -1552,7 +1554,7 @@ class numeric_limits_impl64f
15521554
// Member functions
15531555
static constexpr auto (min) () -> boost::decimal::decimal_fast64_t { return {UINT32_C(1), min_exponent}; }
15541556
static constexpr auto (max) () -> boost::decimal::decimal_fast64_t { return {UINT64_C(9'999'999'999'999'999), max_exponent - digits + 1}; }
1555-
static constexpr auto lowest () -> boost::decimal::decimal_fast64_t { return {UINT64_C(9'999'999'999'999'999), max_exponent - digits + 1, true}; }
1557+
static constexpr auto lowest () -> boost::decimal::decimal_fast64_t { return {UINT64_C(9'999'999'999'999'999), max_exponent - digits + 1, construction_sign::negative}; }
15561558
static constexpr auto epsilon () -> boost::decimal::decimal_fast64_t { return {UINT32_C(1), -digits + 1}; }
15571559
static constexpr auto round_error () -> boost::decimal::decimal_fast64_t { return epsilon(); }
15581560
static constexpr auto infinity () -> boost::decimal::decimal_fast64_t { return boost::decimal::direct_init_d64(

0 commit comments

Comments
 (0)