Skip to content

Commit 5ffac74

Browse files
committed
Remove bit_string function
1 parent b3cd503 commit 5ffac74

File tree

2 files changed

+0
-69
lines changed

2 files changed

+0
-69
lines changed

include/boost/decimal/decimal128_t.hpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -530,10 +530,6 @@ BOOST_DECIMAL_EXPORT class decimal128_t final
530530
BOOST_DECIMAL_REQUIRES_RETURN(detail::is_integral_v, Integer, std::partial_ordering);
531531
#endif
532532

533-
#if !defined(BOOST_DECIMAL_DISABLE_IOSTREAM)
534-
friend inline std::string bit_string(decimal128_t rhs) noexcept;
535-
#endif
536-
537533
// 3.6.4 Same Quantum
538534
friend constexpr auto samequantumd128(const decimal128_t& lhs, const decimal128_t& rhs) noexcept -> bool;
539535

@@ -606,15 +602,6 @@ BOOST_DECIMAL_EXPORT class decimal128_t final
606602
friend constexpr auto fmad128(decimal128_t x, decimal128_t y, decimal128_t z) noexcept -> decimal128_t;
607603
};
608604

609-
#if !defined(BOOST_DECIMAL_DISABLE_IOSTREAM)
610-
inline std::string bit_string(decimal128_t rhs) noexcept
611-
{
612-
std::stringstream ss;
613-
ss << std::hex << rhs.bits_.high << rhs.bits_.low;
614-
return ss.str();
615-
}
616-
#endif
617-
618605
#ifdef BOOST_DECIMAL_HAS_INT128
619606

620607
constexpr auto from_bits(const detail::builtin_uint128_t rhs) noexcept -> decimal128_t

test/test_decimal128_basis.cpp

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -14,61 +14,6 @@
1414

1515
using namespace boost::decimal;
1616

17-
#if BOOST_DECIMAL_ENDIAN_LITTLE_BYTE && defined(BOOST_DECIMAL_HAS_INT128)
18-
void test_binary_constructor()
19-
{
20-
decimal128_t one(0b1, -6175);
21-
// 0 for sign
22-
// 00000 for combination field
23-
// 00000000 for exp
24-
// 1 for significand
25-
BOOST_TEST_EQ(bit_string(one), "4000000000001");
26-
27-
decimal128_t neg_one(-0b1, -6175);
28-
// 1 for sign
29-
// 00000 for combination field
30-
// 00000000 for exp
31-
// 1 for significand
32-
BOOST_TEST_EQ(bit_string(neg_one), "80004000000000001");
33-
34-
decimal128_t two(0b10, -6175);
35-
// 0 for sign
36-
// 00000 for combination field
37-
// 00000000 for exp
38-
// 2 for significand
39-
BOOST_TEST_EQ(bit_string(two), "4000000000002");
40-
41-
decimal128_t three(0b11, -6175);
42-
// 0 for sign
43-
// 00000 for combination field
44-
// 00000000 for exp
45-
// 3 for significand
46-
BOOST_TEST_EQ(bit_string(three), "4000000000003");
47-
48-
decimal128_t big(UINT64_MAX, -6175);
49-
// 0 for sign
50-
// 00000 for combination field
51-
// 00000000 for exp
52-
// FFFFFFFFFFFFFFFF for significand
53-
BOOST_TEST_EQ(bit_string(big), "400000000000ffffffffffffffff");
54-
55-
decimal128_t onee1(0b1, -6174);
56-
// 0 for sign
57-
// 00000 for combination field
58-
// 00000001 for exp
59-
// 1 for significand
60-
BOOST_TEST_EQ(bit_string(onee1), "8000000000001");
61-
}
62-
63-
#else
64-
65-
void test_binary_constructor()
66-
{
67-
//nothing
68-
}
69-
70-
#endif
71-
7217
void test_non_finite_values()
7318
{
7419
const decimal128_t one(0b1, 0);
@@ -123,7 +68,6 @@ void test_float_constructor()
12368

12469
int main()
12570
{
126-
test_binary_constructor();
12771
test_non_finite_values();
12872

12973
test_float_constructor();

0 commit comments

Comments
 (0)