test_checked_modulus.hpp 969 B

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