/////////////////////////////////////////////////////////////////////////////// // Copyright 2024 John Maddock. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #if !defined(TEST_MPF_50) && !defined(TEST_CPP_DEC_FLOAT) && !defined(TEST_MPFR_50) && !defined(TEST_FLOAT128) && !defined(TEST_CPP_BIN_FLOAT) #define TEST_MPF_50 #define TEST_MPFR_50 #define TEST_CPP_DEC_FLOAT #define TEST_FLOAT128 #define TEST_CPP_BIN_FLOAT #ifdef _MSC_VER #pragma message("CAUTION!!: No backend type specified so testing everything.... this will take some time!!") #endif #ifdef __GNUC__ #pragma warning "CAUTION!!: No backend type specified so testing everything.... this will take some time!!" #endif #endif #if defined(TEST_MPF_50) #include #endif #if defined(TEST_MPFR_50) #include #endif #ifdef TEST_CPP_DEC_FLOAT #include #endif #ifdef TEST_FLOAT128 #include #endif #ifdef TEST_CPP_BIN_FLOAT #include #endif #include #include "test.hpp" template void test() { { const T val1{6}; const T val2{3}; T r = boost::multiprecision::fmod(val1, val2); BOOST_CHECK_EQUAL(r, T(0)); } { const T val1{-6}; const T val2{3}; T r = boost::multiprecision::fmod(val1, val2); BOOST_CHECK_EQUAL(r, T(0)); } { const T val1{6}; const T val2{-3}; T r = boost::multiprecision::fmod(val1, val2); BOOST_CHECK_EQUAL(r, T(0)); } { const T val1{-6}; const T val2{-3}; T r = boost::multiprecision::fmod(val1, val2); BOOST_CHECK_EQUAL(r, T(0)); } } int main() { using namespace boost::multiprecision; #ifdef TEST_MPF_50 test(); test(); #endif #ifdef TEST_MPFR_50 test(); test(); #endif #ifdef TEST_CPP_DEC_FLOAT test(); test(); #endif #ifdef TEST_FLOAT128 test(); #endif #ifdef TEST_CPP_BIN_FLOAT test(); test, long long> > >(); #endif return boost::report_errors(); }