test_checked_divide.hpp 968 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef BOOST_SAFE_NUMERICS_TEST_CHECKED_DIVIDE_HPP
  2. #define BOOST_SAFE_NUMERICS_TEST_CHECKED_DIVIDE_HPP
  3. // Copyright (c) 2018 Robert Ramey
  4. //
  5. // Distributed under the Boost Software License, Version 1.0. (See
  6. // accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. #include "test_checked_values.hpp"
  9. // test result matrices
  10. // key
  11. // . success
  12. // - negative_overflow_error
  13. // + positive_overflow_error
  14. // ! range_error
  15. constexpr const char * signed_division_results[] = {
  16. // 012345678
  17. /* 0*/ "!!!!!!!!!",
  18. /* 1*/ "!!!!!!!!!",
  19. /* 2*/ "!!!+++---",
  20. /* 3*/ "!!0..+..0",
  21. /* 4*/ "!!0..+.00",
  22. /* 5*/ "!!000!000",
  23. /* 6*/ "!!0..-.00",
  24. /* 7*/ "!!0..-+.0",
  25. /* 8*/ "!!----++!",
  26. };
  27. constexpr const char * unsigned_division_results[] = {
  28. // 0123456
  29. /* 0*/ "!!!!!!!",
  30. /* 1*/ "!!!!!!!",
  31. /* 2*/ "!!!+++-",
  32. /* 3*/ "!!0..+.",
  33. /* 4*/ "!!0..+.",
  34. /* 5*/ "!!000!0",
  35. /* 6*/ "!!----!",
  36. };
  37. #endif // BOOST_SAFE_NUMERICS_TEST_CHECKED_DIVIDE_HPP