mirror of
https://github.com/boostorg/multiprecision.git
synced 2026-01-27 07:02:10 +00:00
Merge branch 'develop' into gsoc2021_double_float_chris_modify_and_test
This commit is contained in:
@@ -22,22 +22,19 @@
|
||||
#include <vector>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/multiprecision/cpp_double_float.hpp>
|
||||
#include <boost/multiprecision/cpp_dec_float.hpp>
|
||||
#include <boost/random/uniform_real_distribution.hpp>
|
||||
#include <boost/multiprecision/number.hpp>
|
||||
#ifdef BOOST_MATH_USE_FLOAT128
|
||||
#include <boost/multiprecision/float128.hpp>
|
||||
#endif
|
||||
#include <boost/multiprecision/cpp_double_float.hpp>
|
||||
#include <boost/multiprecision/cpp_dec_float.hpp>
|
||||
#include <boost/random/uniform_real_distribution.hpp>
|
||||
#include <boost/core/demangle.hpp>
|
||||
|
||||
namespace test_arithmetic_cpp_double_float {
|
||||
|
||||
template <typename FloatingPointType,
|
||||
typename std::enable_if<( std::is_floating_point<FloatingPointType>::value == true
|
||||
#ifdef BOOST_MATH_USE_FLOAT128
|
||||
||std::is_same<FloatingPointType,boost::multiprecision::float128>::value == true
|
||||
#endif
|
||||
), bool>::type = true>
|
||||
typename std::enable_if<( boost::multiprecision::backends::detail::is_floating_point_or_float128<FloatingPointType>::value == true), bool>::type = true>
|
||||
FloatingPointType uniform_real()
|
||||
{
|
||||
using distribution_type = boost::random::uniform_real_distribution<FloatingPointType>;
|
||||
@@ -62,11 +59,7 @@ int rand_in_range(int a, int b)
|
||||
}
|
||||
|
||||
template <typename FloatingPointType,
|
||||
typename std::enable_if<( std::is_floating_point<FloatingPointType>::value == true
|
||||
#ifdef BOOST_MATH_USE_FLOAT128
|
||||
||std::is_same<FloatingPointType,boost::multiprecision::float128>::value == true
|
||||
#endif
|
||||
), bool>::type = true>
|
||||
typename std::enable_if<( boost::multiprecision::backends::detail::is_floating_point_or_float128<FloatingPointType>::value == true), bool>::type = true>
|
||||
FloatingPointType uniform_rand()
|
||||
{
|
||||
return uniform_real<FloatingPointType>();
|
||||
@@ -81,11 +74,7 @@ boost::multiprecision::backends::cpp_double_float<typename FloatingPointType::fl
|
||||
|
||||
|
||||
template <typename FloatingPointType>
|
||||
typename std::enable_if<( std::is_floating_point<FloatingPointType>::value == true
|
||||
#ifdef BOOST_MATH_USE_FLOAT128
|
||||
||std::is_same<FloatingPointType,boost::multiprecision::float128>::value == true
|
||||
#endif
|
||||
), FloatingPointType>::type
|
||||
typename std::enable_if<( boost::multiprecision::backends::detail::is_floating_point_or_float128<FloatingPointType>::value == true), FloatingPointType>::type
|
||||
log_rand()
|
||||
{
|
||||
if (uniform_real<float>() < (1. / 100.))
|
||||
|
||||
Reference in New Issue
Block a user