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