|
| 1 | +// (C) Copyright Marco Ribeiro 2026. |
| 2 | +// Use, modification and distribution are subject to the |
| 3 | +// Boost Software License, Version 1.0. (See accompanying file |
| 4 | +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 5 | + |
| 6 | +#include "constexpr_arithmetric_test.hpp" |
| 7 | +#include "boost/multiprecision/cpp_int.hpp" |
| 8 | +#include "test.hpp" |
| 9 | + |
| 10 | +#if !defined(BOOST_MP_NO_CONSTEXPR_DETECTION) && !defined(DISABLE_TESTS) |
| 11 | + |
| 12 | +int main() |
| 13 | +{ |
| 14 | + namespace mp = boost::multiprecision; |
| 15 | + |
| 16 | + using int512_et_off = mp::number<mp::cpp_int_backend< |
| 17 | + 512, 512, mp::signed_magnitude, mp::unchecked, void |
| 18 | + >, mp::et_off>; |
| 19 | + |
| 20 | + using int512_et_on = mp::number<mp::cpp_int_backend< |
| 21 | + 512, 512, mp::signed_magnitude, mp::unchecked, void |
| 22 | + >, mp::et_on>; |
| 23 | + |
| 24 | + static_assert(mp::abs(int512_et_off(-12345)) == 12345); |
| 25 | + static_assert(mp::conj(int512_et_off(100)) == 100); |
| 26 | + static_assert(mp::proj(int512_et_off(100)) == 100); |
| 27 | + static_assert(mp::powm(int512_et_off(-5), 2, 7) == 4); |
| 28 | + |
| 29 | + static_assert(mp::abs(int512_et_on(-12345)) == 12345); |
| 30 | + static_assert(mp::conj(int512_et_on(100)) == 100); |
| 31 | + static_assert(mp::proj(int512_et_on(100)) == 100); |
| 32 | + static_assert(mp::powm(int512_et_on(-5), 2, 7) == 4); |
| 33 | +} |
| 34 | +#else |
| 35 | +int main() {} |
| 36 | +#endif |
| 37 | + |
0 commit comments