test_checked_multiply.hpp 987 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef BOOST_SAFE_NUMERICS_TEST_CHECKED_MULTIPLY_HPP
  2. #define BOOST_SAFE_NUMERICS_TEST_CHECKED_MULTIPLY_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_multiplication_results[] = {
  16. // 012345678
  17. /* 0*/ "!!!!!!!!!",
  18. /* 1*/ "!!!!!!!!!",
  19. /* 2*/ "!!+++.---",
  20. /* 3*/ "!!++...--",
  21. /* 4*/ "!!+.....-",
  22. /* 5*/ "!!...0000",
  23. /* 6*/ "!!-..0.++",
  24. /* 7*/ "!!--.0+++",
  25. /* 8*/ "!!---0+++",
  26. };
  27. constexpr const char * unsigned_multiplication_results[] = {
  28. // 0123456
  29. /* 0*/ "!!!!!!!",
  30. /* 1*/ "!!!!!!!",
  31. /* 2*/ "!!+++.-",
  32. /* 3*/ "!!++..-",
  33. /* 4*/ "!!+...-",
  34. /* 5*/ "!!...00",
  35. /* 6*/ "!!---0+",
  36. };
  37. #endif // BOOST_SAFE_NUMERICS_TEST_CHECKED_MULTIPLY_HPP