1 // (C) Copyright John Maddock 2007.
2 // Use, modification and distribution are subject to the
3 // Boost Software License, Version 1.0. (See accompanying file
4 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 # define _SCL_SECURE_NO_WARNINGS
10 #include <boost/detail/lightweight_test.hpp>
11 #include <boost/math/special_functions/round.hpp>
12 #include <boost/math/special_functions/trunc.hpp>
13 #include <boost/math/special_functions/modf.hpp>
14 #include <boost/math/special_functions/sign.hpp>
15 #include <boost/random/mersenne_twister.hpp>
18 #if !defined(TEST_MPF_50) && !defined(TEST_MPF) && !defined(TEST_BACKEND) && !defined(TEST_CPP_DEC_FLOAT)\
19 && !defined(TEST_MPFR) && !defined(TEST_MPFR_50) && !defined(TEST_MPFI_50) && !defined(TEST_FLOAT128)\
20 && !defined(TEST_CPP_BIN_FLOAT)
25 # define TEST_CPP_DEC_FLOAT
26 # define TEST_FLOAT128
27 # define TEST_CPP_BIN_FLOAT
30 #pragma message("CAUTION!!: No backend type specified so testing everything.... this will take some time!!")
33 #pragma warning "CAUTION!!: No backend type specified so testing everything.... this will take some time!!"
38 #if defined(TEST_MPF_50)
39 #include <boost/multiprecision/gmp.hpp>
42 #include <boost/multiprecision/mpfr.hpp>
45 #include <boost/multiprecision/mpfi.hpp>
48 #include <boost/multiprecision/concepts/mp_number_archetypes.hpp>
50 #ifdef TEST_CPP_DEC_FLOAT
51 #include <boost/multiprecision/cpp_dec_float.hpp>
53 #ifdef TEST_CPP_BIN_FLOAT
54 #include <boost/multiprecision/cpp_bin_float.hpp>
57 #include <boost/multiprecision/float128.hpp>
61 #pragma warning(disable:4127)
70 // Fill all the bits in T with random values,
71 // likewise set the exponent to a random value
72 // that will still fit inside a T, and always
73 // have a remainder as well as an integer part.
75 int bits
= boost::math::tools::digits
<T
>();
77 int exponent
= rng() % (bits
- 4);
81 result
+= ldexp(static_cast<T
>(rng()), shift
);
82 shift
+= std::numeric_limits
<int>::digits
;
83 bits
-= std::numeric_limits
<int>::digits
;
85 return rng() & 1u ? T(-ldexp(frexp(result
, &bits
), exponent
)) : T(ldexp(frexp(result
, &bits
), exponent
));
88 template <class T
, class U
>
89 typename
boost::disable_if_c
<boost::multiprecision::is_interval_number
<T
>::value
>::type
check_within_half(T a
, U u
)
94 BOOST_ERROR("Rounded result differed by more than 0.5 from the original");
95 std::cerr
<< "Values were: " << std::setprecision(35) << std::setw(40)
96 << std::left
<< a
<< u
<< std::endl
;
98 if((fabs(a
- u
) == 0.5f
) && (fabs(static_cast<T
>(u
)) < fabs(a
)))
100 BOOST_ERROR("Rounded result was towards zero with boost::round");
101 std::cerr
<< "Values were: " << std::setprecision(35) << std::setw(40)
102 << std::left
<< a
<< u
<< std::endl
;
105 template <class T
, class U
>
106 typename
boost::enable_if_c
<boost::multiprecision::is_interval_number
<T
>::value
>::type
check_within_half(T a
, U u
)
109 if(upper(T(fabs(a
-u
))) > 0.5f
)
111 BOOST_ERROR("Rounded result differed by more than 0.5 from the original");
112 std::cerr
<< "Values were: " << std::setprecision(35) << std::setw(40)
113 << std::left
<< a
<< u
<< std::endl
;
115 if((upper(T(fabs(a
- u
))) == 0.5f
) && (fabs(static_cast<T
>(u
)) < fabs(a
)))
117 BOOST_ERROR("Rounded result was towards zero with boost::round");
118 std::cerr
<< "Values were: " << std::setprecision(35) << std::setw(40)
119 << std::left
<< a
<< u
<< std::endl
;
124 // We may not have an abs overload for long long so provide a fall back:
126 inline unsigned safe_abs(int const& v
)
128 return v
< 0 ? static_cast<unsigned>(1u) + static_cast<unsigned>(-(v
+1)) : v
;
130 inline unsigned long safe_abs(long const& v
)
132 return v
< 0 ? static_cast<unsigned long>(1u) + static_cast<unsigned long>(-(v
+1)) : v
;
134 inline unsigned long long safe_abs(long long const& v
)
136 return v
< 0 ? static_cast<unsigned long long>(1u) + static_cast<unsigned long long>(-(v
+1)) : v
;
139 inline typename
boost::disable_if_c
<boost::is_integral
<T
>::value
, T
>::type
safe_abs(T
const& v
)
141 return v
< 0 ? -v
: v
;
144 template <class T
, class U
>
145 void check_trunc_result(T a
, U u
)
150 BOOST_ERROR("Rounded result differed by more than 1 from the original");
151 std::cerr
<< "Values were: " << std::setprecision(35) << std::setw(40)
152 << std::left
<< a
<< u
<< std::endl
;
154 if(abs(a
) < safe_abs(u
))
156 BOOST_ERROR("Truncated result had larger absolute value than the original");
157 std::cerr
<< "Values were: " << std::setprecision(35) << std::setw(40)
158 << std::left
<< a
<< u
<< std::endl
;
160 if(fabs(static_cast<T
>(u
)) > fabs(a
))
162 BOOST_ERROR("Rounded result was away from zero with boost::trunc");
163 std::cerr
<< "Values were: " << std::setprecision(35) << std::setw(40)
164 << std::left
<< a
<< u
<< std::endl
;
168 template <class T
, class U
>
169 void check_modf_result(T a
, T fract
, U ipart
)
172 if(fract
+ ipart
!= a
)
174 BOOST_ERROR("Fractional and integer results do not add up to the original value");
175 std::cerr
<< "Values were: " << std::setprecision(35) << " "
176 << std::left
<< a
<< ipart
<< " " << fract
<< std::endl
;
178 if((boost::math::sign(a
) != boost::math::sign(fract
)) && boost::math::sign(fract
))
180 BOOST_ERROR("Original and fractional parts have differing signs");
181 std::cerr
<< "Values were: " << std::setprecision(35) << " "
182 << std::left
<< a
<< ipart
<< " " << fract
<< std::endl
;
184 if((boost::math::sign(a
) != boost::math::sign(ipart
)) && boost::math::sign(ipart
))
186 BOOST_ERROR("Original and integer parts have differing signs");
187 std::cerr
<< "Values were: " << std::setprecision(35) << " "
188 << std::left
<< a
<< ipart
<< " " << ipart
<< std::endl
;
190 if(fabs(a
-ipart
) >= 1)
192 BOOST_ERROR("Rounded result differed by more than 1 from the original");
193 std::cerr
<< "Values were: " << std::setprecision(35) << std::setw(40)
194 << std::left
<< a
<< ipart
<< std::endl
;
203 for(int i
= 0; i
< 1000; ++i
)
205 T arg
= get_random
<T
>();
207 check_within_half(arg
, r
);
208 BOOST_TEST(r
== round(arg
+ 0));
210 check_trunc_result(arg
, r
);
211 BOOST_TEST(r
== trunc(arg
+ 0));
212 T frac
= modf(arg
, &r
);
213 check_modf_result(arg
, frac
, r
);
215 if(abs(r
) < (std::numeric_limits
<int>::max
)())
218 check_within_half(arg
, i
);
219 BOOST_TEST(i
== iround(arg
+ 0));
221 check_trunc_result(arg
, i
);
222 BOOST_TEST(i
== itrunc(arg
+ 0));
224 check_modf_result(arg
, r
, i
);
226 if(abs(r
) < (std::numeric_limits
<long>::max
)())
228 long l
= lround(arg
);
229 check_within_half(arg
, l
);
230 BOOST_TEST(l
== lround(arg
+ 0));
232 check_trunc_result(arg
, l
);
233 BOOST_TEST(l
== ltrunc(arg
+ 0));
235 check_modf_result(arg
, r
, l
);
238 #ifdef BOOST_HAS_LONG_LONG
239 if(abs(r
) < (std::numeric_limits
<boost::long_long_type
>::max
)())
241 boost::long_long_type ll
= llround(arg
);
242 check_within_half(arg
, ll
);
243 BOOST_TEST(ll
== llround(arg
+ 0));
245 check_trunc_result(arg
, ll
);
246 BOOST_TEST(ll
== lltrunc(arg
+ 0));
248 check_modf_result(arg
, r
, ll
);
253 // Test boundary cases:
255 if(std::numeric_limits
<T
>::digits
>= std::numeric_limits
<int>::digits
)
257 int si
= iround(static_cast<T
>((std::numeric_limits
<int>::max
)()));
258 check_within_half(static_cast<T
>((std::numeric_limits
<int>::max
)()), si
);
259 BOOST_TEST(si
== iround(static_cast<T
>((std::numeric_limits
<int>::max
)()) + 0));
260 si
= iround(static_cast<T
>((std::numeric_limits
<int>::min
)()));
261 check_within_half(static_cast<T
>((std::numeric_limits
<int>::min
)()), si
);
262 BOOST_TEST(si
== iround(static_cast<T
>((std::numeric_limits
<int>::min
)()) + 0));
263 si
= itrunc(static_cast<T
>((std::numeric_limits
<int>::max
)()));
264 check_trunc_result(static_cast<T
>((std::numeric_limits
<int>::max
)()), si
);
265 BOOST_TEST(si
== itrunc(static_cast<T
>((std::numeric_limits
<int>::max
)()) + 0));
266 si
= itrunc(static_cast<T
>((std::numeric_limits
<int>::min
)()));
267 check_trunc_result(static_cast<T
>((std::numeric_limits
<int>::min
)()), si
);
268 BOOST_TEST(si
== itrunc(static_cast<T
>((std::numeric_limits
<int>::min
)()) + 0));
270 si
= iround(static_cast<T
>((std::numeric_limits
<int>::max
)() - 1));
271 check_within_half(static_cast<T
>((std::numeric_limits
<int>::max
)() - 1), si
);
272 si
= iround(static_cast<T
>((std::numeric_limits
<int>::min
)() + 1));
273 check_within_half(static_cast<T
>((std::numeric_limits
<int>::min
)() + 1), si
);
274 si
= itrunc(static_cast<T
>((std::numeric_limits
<int>::max
)() - 1));
275 check_trunc_result(static_cast<T
>((std::numeric_limits
<int>::max
)() - 1), si
);
276 si
= itrunc(static_cast<T
>((std::numeric_limits
<int>::min
)() + 1));
277 check_trunc_result(static_cast<T
>((std::numeric_limits
<int>::min
)() + 1), si
);
279 if(std::numeric_limits
<T
>::digits
>= std::numeric_limits
<long>::digits
)
281 long k
= lround(static_cast<T
>((std::numeric_limits
<long>::max
)()));
282 check_within_half(static_cast<T
>((std::numeric_limits
<long>::max
)()), k
);
283 BOOST_TEST(k
== lround(static_cast<T
>((std::numeric_limits
<long>::max
)()) + 0));
284 k
= lround(static_cast<T
>((std::numeric_limits
<long>::min
)()));
285 check_within_half(static_cast<T
>((std::numeric_limits
<long>::min
)()), k
);
286 BOOST_TEST(k
== lround(static_cast<T
>((std::numeric_limits
<long>::min
)()) + 0));
287 k
= ltrunc(static_cast<T
>((std::numeric_limits
<long>::max
)()));
288 check_trunc_result(static_cast<T
>((std::numeric_limits
<long>::max
)()), k
);
289 BOOST_TEST(k
== ltrunc(static_cast<T
>((std::numeric_limits
<long>::max
)()) + 0));
290 k
= ltrunc(static_cast<T
>((std::numeric_limits
<long>::min
)()));
291 check_trunc_result(static_cast<T
>((std::numeric_limits
<long>::min
)()), k
);
292 BOOST_TEST(k
== ltrunc(static_cast<T
>((std::numeric_limits
<long>::min
)()) + 0));
294 k
= lround(static_cast<T
>((std::numeric_limits
<long>::max
)() - 1));
295 check_within_half(static_cast<T
>((std::numeric_limits
<long>::max
)() - 1), k
);
296 k
= lround(static_cast<T
>((std::numeric_limits
<long>::min
)() + 1));
297 check_within_half(static_cast<T
>((std::numeric_limits
<long>::min
)() + 1), k
);
298 k
= ltrunc(static_cast<T
>((std::numeric_limits
<long>::max
)() - 1));
299 check_trunc_result(static_cast<T
>((std::numeric_limits
<long>::max
)() - 1), k
);
300 k
= ltrunc(static_cast<T
>((std::numeric_limits
<long>::min
)() + 1));
301 check_trunc_result(static_cast<T
>((std::numeric_limits
<long>::min
)() + 1), k
);
303 #ifndef BOOST_NO_LONG_LONG
304 if(std::numeric_limits
<T
>::digits
>= std::numeric_limits
<boost::long_long_type
>::digits
)
306 boost::long_long_type j
= llround(static_cast<T
>((std::numeric_limits
<boost::long_long_type
>::max
)()));
307 check_within_half(static_cast<T
>((std::numeric_limits
<boost::long_long_type
>::max
)()), j
);
308 BOOST_TEST(j
== llround(static_cast<T
>((std::numeric_limits
<long long>::max
)()) + 0));
309 j
= llround(static_cast<T
>((std::numeric_limits
<boost::long_long_type
>::min
)()));
310 check_within_half(static_cast<T
>((std::numeric_limits
<boost::long_long_type
>::min
)()), j
);
311 BOOST_TEST(j
== llround(static_cast<T
>((std::numeric_limits
<long long>::min
)()) + 0));
312 j
= lltrunc(static_cast<T
>((std::numeric_limits
<boost::long_long_type
>::max
)()));
313 check_trunc_result(static_cast<T
>((std::numeric_limits
<boost::long_long_type
>::max
)()), j
);
314 BOOST_TEST(j
== lltrunc(static_cast<T
>((std::numeric_limits
<long long>::max
)()) + 0));
315 j
= lltrunc(static_cast<T
>((std::numeric_limits
<boost::long_long_type
>::min
)()));
316 check_trunc_result(static_cast<T
>((std::numeric_limits
<boost::long_long_type
>::min
)()), j
);
317 BOOST_TEST(j
== lltrunc(static_cast<T
>((std::numeric_limits
<long long>::min
)()) + 0));
319 j
= llround(static_cast<T
>((std::numeric_limits
<boost::long_long_type
>::max
)() - 1));
320 check_within_half(static_cast<T
>((std::numeric_limits
<boost::long_long_type
>::max
)() - 1), j
);
321 j
= llround(static_cast<T
>((std::numeric_limits
<boost::long_long_type
>::min
)() + 1));
322 check_within_half(static_cast<T
>((std::numeric_limits
<boost::long_long_type
>::min
)() + 1), j
);
323 j
= lltrunc(static_cast<T
>((std::numeric_limits
<boost::long_long_type
>::max
)() - 1));
324 check_trunc_result(static_cast<T
>((std::numeric_limits
<boost::long_long_type
>::max
)() - 1), j
);
325 j
= lltrunc(static_cast<T
>((std::numeric_limits
<boost::long_long_type
>::min
)() + 1));
326 check_trunc_result(static_cast<T
>((std::numeric_limits
<boost::long_long_type
>::min
)() + 1), j
);
330 // Finish off by testing the error handlers:
333 #ifndef BOOST_NO_EXCEPTIONS
334 BOOST_CHECK_THROW(result
= static_cast<T
>(iround(static_cast<T
>(1e20
))), boost::math::rounding_error
);
335 BOOST_CHECK_THROW(result
= static_cast<T
>(iround(static_cast<T
>(-1e20
))), boost::math::rounding_error
);
336 BOOST_CHECK_THROW(result
= static_cast<T
>(lround(static_cast<T
>(1e20
))), boost::math::rounding_error
);
337 BOOST_CHECK_THROW(result
= static_cast<T
>(lround(static_cast<T
>(-1e20
))), boost::math::rounding_error
);
338 #ifdef BOOST_HAS_LONG_LONG
339 BOOST_CHECK_THROW(result
= static_cast<T
>(llround(static_cast<T
>(1e20
))), boost::math::rounding_error
);
340 BOOST_CHECK_THROW(result
= static_cast<T
>(llround(static_cast<T
>(-1e20
))), boost::math::rounding_error
);
342 if(std::numeric_limits
<T
>::has_infinity
)
344 BOOST_CHECK_EQUAL(static_cast<T
>(round(std::numeric_limits
<T
>::infinity())), std::numeric_limits
<T
>::infinity()); // See C99 Annex F.
345 BOOST_CHECK_THROW(result
= static_cast<T
>(iround(std::numeric_limits
<T
>::infinity())), boost::math::rounding_error
);
346 BOOST_CHECK_THROW(result
= static_cast<T
>(iround(-std::numeric_limits
<T
>::infinity())), boost::math::rounding_error
);
347 BOOST_CHECK_THROW(result
= static_cast<T
>(lround(std::numeric_limits
<T
>::infinity())), boost::math::rounding_error
);
348 BOOST_CHECK_THROW(result
= static_cast<T
>(lround(-std::numeric_limits
<T
>::infinity())), boost::math::rounding_error
);
349 #ifdef BOOST_HAS_LONG_LONG
350 BOOST_CHECK_THROW(result
= static_cast<T
>(llround(std::numeric_limits
<T
>::infinity())), boost::math::rounding_error
);
351 BOOST_CHECK_THROW(result
= static_cast<T
>(llround(-std::numeric_limits
<T
>::infinity())), boost::math::rounding_error
);
354 if(std::numeric_limits
<T
>::has_quiet_NaN
)
356 BOOST_CHECK((boost::multiprecision::isnan
)(round(std::numeric_limits
<T
>::quiet_NaN())));
357 BOOST_CHECK_THROW(result
= static_cast<T
>(iround(std::numeric_limits
<T
>::quiet_NaN())), boost::math::rounding_error
);
358 BOOST_CHECK_THROW(result
= static_cast<T
>(lround(std::numeric_limits
<T
>::quiet_NaN())), boost::math::rounding_error
);
359 #ifdef BOOST_HAS_LONG_LONG
360 BOOST_CHECK_THROW(result
= static_cast<T
>(llround(std::numeric_limits
<T
>::quiet_NaN())), boost::math::rounding_error
);
363 BOOST_CHECK_THROW(result
= static_cast<T
>(itrunc(static_cast<T
>(1e20
))), boost::math::rounding_error
);
364 BOOST_CHECK_THROW(result
= static_cast<T
>(itrunc(static_cast<T
>(-1e20
))), boost::math::rounding_error
);
365 BOOST_CHECK_THROW(result
= static_cast<T
>(ltrunc(static_cast<T
>(1e20
))), boost::math::rounding_error
);
366 BOOST_CHECK_THROW(result
= static_cast<T
>(ltrunc(static_cast<T
>(-1e20
))), boost::math::rounding_error
);
367 #ifdef BOOST_HAS_LONG_LONG
368 BOOST_CHECK_THROW(result
= static_cast<T
>(lltrunc(static_cast<T
>(1e20
))), boost::math::rounding_error
);
369 BOOST_CHECK_THROW(result
= static_cast<T
>(lltrunc(static_cast<T
>(-1e20
))), boost::math::rounding_error
);
371 if(std::numeric_limits
<T
>::has_infinity
)
373 BOOST_CHECK_EQUAL(static_cast<T
>(trunc(std::numeric_limits
<T
>::infinity())), std::numeric_limits
<T
>::infinity());
374 BOOST_CHECK_EQUAL(static_cast<T
>(trunc(-std::numeric_limits
<T
>::infinity())), -std::numeric_limits
<T
>::infinity());
375 BOOST_CHECK_THROW(result
= static_cast<T
>(itrunc(std::numeric_limits
<T
>::infinity())), boost::math::rounding_error
);
376 BOOST_CHECK_THROW(result
= static_cast<T
>(itrunc(-std::numeric_limits
<T
>::infinity())), boost::math::rounding_error
);
377 BOOST_CHECK_THROW(result
= static_cast<T
>(ltrunc(std::numeric_limits
<T
>::infinity())), boost::math::rounding_error
);
378 BOOST_CHECK_THROW(result
= static_cast<T
>(ltrunc(-std::numeric_limits
<T
>::infinity())), boost::math::rounding_error
);
379 #ifdef BOOST_HAS_LONG_LONG
380 BOOST_CHECK_THROW(result
= static_cast<T
>(lltrunc(std::numeric_limits
<T
>::infinity())), boost::math::rounding_error
);
381 BOOST_CHECK_THROW(result
= static_cast<T
>(lltrunc(-std::numeric_limits
<T
>::infinity())), boost::math::rounding_error
);
384 if(std::numeric_limits
<T
>::has_quiet_NaN
)
386 BOOST_CHECK((boost::multiprecision::isnan
)(trunc(std::numeric_limits
<T
>::quiet_NaN())));
387 BOOST_CHECK_THROW(result
= static_cast<T
>(itrunc(std::numeric_limits
<T
>::quiet_NaN())), boost::math::rounding_error
);
388 BOOST_CHECK_THROW(result
= static_cast<T
>(ltrunc(std::numeric_limits
<T
>::quiet_NaN())), boost::math::rounding_error
);
389 #ifdef BOOST_HAS_LONG_LONG
390 BOOST_CHECK_THROW(result
= static_cast<T
>(lltrunc(std::numeric_limits
<T
>::quiet_NaN())), boost::math::rounding_error
);
393 if(std::numeric_limits
<T
>::digits
>= std::numeric_limits
<int>::digits
)
395 BOOST_CHECK_THROW(result
= static_cast<T
>(itrunc(static_cast<T
>((std::numeric_limits
<int>::max
)()) + 1)), boost::math::rounding_error
);
396 BOOST_CHECK_THROW(result
= static_cast<T
>(itrunc(static_cast<T
>((std::numeric_limits
<int>::min
)()) - 1)), boost::math::rounding_error
);
398 if(std::numeric_limits
<T
>::digits
>= std::numeric_limits
<long>::digits
)
400 BOOST_CHECK_THROW(result
= static_cast<T
>(ltrunc(static_cast<T
>((std::numeric_limits
<long>::max
)()) + 1)), boost::math::rounding_error
);
401 BOOST_CHECK_THROW(result
= static_cast<T
>(ltrunc(static_cast<T
>((std::numeric_limits
<long>::min
)()) - 1)), boost::math::rounding_error
);
403 #ifndef BOOST_NO_LONG_LONG
404 if(std::numeric_limits
<T
>::digits
>= std::numeric_limits
<boost::long_long_type
>::digits
)
406 BOOST_CHECK_THROW(result
= static_cast<T
>(lltrunc(static_cast<T
>((std::numeric_limits
<boost::long_long_type
>::max
)()) + 1)), boost::math::rounding_error
);
407 BOOST_CHECK_THROW(result
= static_cast<T
>(lltrunc(static_cast<T
>((std::numeric_limits
<boost::long_long_type
>::min
)()) - 1)), boost::math::rounding_error
);
410 if(std::numeric_limits
<T
>::digits
>= std::numeric_limits
<int>::digits
)
412 BOOST_CHECK_THROW(result
= static_cast<T
>(iround(static_cast<T
>((std::numeric_limits
<int>::max
)()) + 1)), boost::math::rounding_error
);
413 BOOST_CHECK_THROW(result
= static_cast<T
>(iround(static_cast<T
>((std::numeric_limits
<int>::min
)()) - 1)), boost::math::rounding_error
);
415 if(std::numeric_limits
<T
>::digits
>= std::numeric_limits
<long>::digits
)
417 BOOST_CHECK_THROW(result
= static_cast<T
>(lround(static_cast<T
>((std::numeric_limits
<long>::max
)()) + 1)), boost::math::rounding_error
);
418 BOOST_CHECK_THROW(result
= static_cast<T
>(lround(static_cast<T
>((std::numeric_limits
<long>::min
)()) - 1)), boost::math::rounding_error
);
420 #ifndef BOOST_NO_LONG_LONG
421 if(std::numeric_limits
<T
>::digits
>= std::numeric_limits
<boost::long_long_type
>::digits
)
423 BOOST_CHECK_THROW(result
= static_cast<T
>(llround(static_cast<T
>((std::numeric_limits
<boost::long_long_type
>::max
)()) + 1)), boost::math::rounding_error
);
424 BOOST_CHECK_THROW(result
= static_cast<T
>(llround(static_cast<T
>((std::numeric_limits
<boost::long_long_type
>::min
)()) - 1)), boost::math::rounding_error
);
433 test
<boost::multiprecision::mpf_float_50
>();
434 test
<boost::multiprecision::mpf_float_100
>();
437 test
<boost::multiprecision::mpfr_float_50
>();
438 test
<boost::multiprecision::mpfr_float_100
>();
441 test
<boost::multiprecision::mpfi_float_50
>();
442 test
<boost::multiprecision::mpfi_float_100
>();
444 #ifdef TEST_CPP_DEC_FLOAT
445 test
<boost::multiprecision::cpp_dec_float_50
>();
446 test
<boost::multiprecision::cpp_dec_float_100
>();
448 // Some "peculiar" digit counts which stress our code:
449 test
<boost::multiprecision::number
<boost::multiprecision::cpp_dec_float
<65> > >();
450 test
<boost::multiprecision::number
<boost::multiprecision::cpp_dec_float
<64> > >();
451 test
<boost::multiprecision::number
<boost::multiprecision::cpp_dec_float
<63> > >();
452 test
<boost::multiprecision::number
<boost::multiprecision::cpp_dec_float
<62> > >();
453 test
<boost::multiprecision::number
<boost::multiprecision::cpp_dec_float
<61, long long> > >();
454 test
<boost::multiprecision::number
<boost::multiprecision::cpp_dec_float
<60, long long> > >();
455 test
<boost::multiprecision::number
<boost::multiprecision::cpp_dec_float
<59, long long, std::allocator
<void> > > >();
456 test
<boost::multiprecision::number
<boost::multiprecision::cpp_dec_float
<58, long long, std::allocator
<void> > > >();
459 #ifdef TEST_CPP_BIN_FLOAT
460 test
<boost::multiprecision::cpp_bin_float_50
>();
461 test
<boost::multiprecision::cpp_bin_float_100
>();
464 test
<boost::multiprecision::number
<boost::multiprecision::concepts::number_backend_float_architype
> >();
467 test
<boost::multiprecision::float128
>();
469 return boost::report_errors();