| 1 | // Copyright Louis Dionne 2013-2022 |
| 2 | // Distributed under the Boost Software License, Version 1.0. |
| 3 | // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) |
| 4 | |
| 5 | #include <boost/hana/div.hpp> |
| 6 | #include <boost/hana/mod.hpp> |
| 7 | #include <boost/hana/tuple.hpp> |
| 8 | |
| 9 | #include <laws/euclidean_ring.hpp> |
| 10 | namespace hana = boost::hana; |
| 11 | |
| 12 | |
| 13 | int main() { |
| 14 | hana::test::TestEuclideanRing<int>{hana::make_tuple(0,1,2,3,4,5)}; |
| 15 | hana::test::TestEuclideanRing<long>{hana::make_tuple(0l,1l,2l,3l,4l,5l)}; |
| 16 | |
| 17 | // div |
| 18 | { |
| 19 | static_assert(hana::div(6, 4) == 6 / 4, "" ); |
| 20 | static_assert(hana::div(7, -3) == 7 / -3, "" ); |
| 21 | } |
| 22 | |
| 23 | // mod |
| 24 | { |
| 25 | static_assert(hana::mod(6, 4) == 6 % 4, "" ); |
| 26 | static_assert(hana::mod(7, -3) == 7 % -3, "" ); |
| 27 | } |
| 28 | } |
| 29 | |