mirror of
https://github.com/boostorg/multiprecision.git
synced 2026-07-21 13:23:49 +00:00
Merge pull request #761 from boostorg/743
Add `data()` member to float128
This commit is contained in:
@@ -296,6 +296,14 @@ struct float128_backend
|
||||
{
|
||||
return m_value;
|
||||
}
|
||||
BOOST_MP_CXX14_CONSTEXPR float128_type& data()
|
||||
{
|
||||
return m_value;
|
||||
}
|
||||
BOOST_MP_CXX14_CONSTEXPR const float128_type& data() const
|
||||
{
|
||||
return m_value;
|
||||
}
|
||||
};
|
||||
|
||||
inline BOOST_MP_CXX14_CONSTEXPR void eval_add(float128_backend& result, const float128_backend& a)
|
||||
|
||||
@@ -1281,6 +1281,7 @@ test-suite misc :
|
||||
[ run git_issue_636.cpp : : : [ check-target-builds ../config//has_float128 : <source>quadmath : <build>no ] ]
|
||||
[ run git_issue_652.cpp ]
|
||||
[ run git_issue_734.cpp ]
|
||||
[ run git_issue_743.cpp : : : [ check-target-builds ../config//has_float128 : <source>quadmath : <build>no ] ]
|
||||
[ run git_issue_759.cpp : : : [ check-target-builds ../config//has_float128 : <source>quadmath : <build>no ] ]
|
||||
[ compile git_issue_98.cpp :
|
||||
[ check-target-builds ../config//has_float128 : <define>TEST_FLOAT128 <source>quadmath : ]
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright 2026 Matt Borland. Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See: https://github.com/boostorg/multiprecision/issues/743
|
||||
|
||||
#include <boost/multiprecision/float128.hpp>
|
||||
#include "test.hpp"
|
||||
|
||||
int main()
|
||||
{
|
||||
using real = boost::multiprecision::float128;
|
||||
|
||||
constexpr real value {5};
|
||||
BOOST_CHECK(value.backend().value() == value.backend().data());
|
||||
|
||||
real mutable_value {42};
|
||||
BOOST_CHECK(mutable_value.backend().value() == mutable_value.backend().data());
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
Reference in New Issue
Block a user