test_mixed_cpp_dec_float.cpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. ///////////////////////////////////////////////////////////////
  2. // Copyright 2012 John Maddock. Distributed under the Boost
  3. // Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
  5. #ifdef _MSC_VER
  6. #define _SCL_SECURE_NO_WARNINGS
  7. #endif
  8. #include <boost/multiprecision/cpp_dec_float.hpp>
  9. #include "test_mixed.hpp"
  10. int main()
  11. {
  12. #ifndef BOOST_NO_EXCEPTIONS
  13. try
  14. {
  15. #endif
  16. typedef boost::multiprecision::number<boost::multiprecision::cpp_dec_float<100>, boost::multiprecision::et_on> big_type1;
  17. typedef boost::multiprecision::number<boost::multiprecision::cpp_dec_float<50>, boost::multiprecision::et_on> small_type1;
  18. typedef boost::multiprecision::number<boost::multiprecision::cpp_dec_float<100>, boost::multiprecision::et_off> big_type2;
  19. typedef boost::multiprecision::number<boost::multiprecision::cpp_dec_float<50>, boost::multiprecision::et_off> small_type2;
  20. test<big_type1, small_type1>();
  21. test<big_type2, small_type2>();
  22. test<big_type1, small_type2>();
  23. test<big_type2, small_type1>();
  24. #ifndef BOOST_NO_EXCEPTIONS
  25. }
  26. catch (const std::exception& e)
  27. {
  28. std::cout << "Failed with unexpected exception: " << e.what() << std::endl;
  29. return 1;
  30. }
  31. #endif
  32. return boost::report_errors();
  33. }