diff --git a/include/boost/math/octonion.hpp b/include/boost/math/octonion.hpp index 0788b99b8..ca9223183 100644 --- a/include/boost/math/octonion.hpp +++ b/include/boost/math/octonion.hpp @@ -3423,7 +3423,9 @@ namespace boost template inline T abs(const octonion & o) { +#ifndef BOOST_NO_STDC_NAMESPACE using ::std::sqrt; +#endif BOOST_OCTONION_VALARRAY_LOADER @@ -3488,8 +3490,13 @@ namespace boost T const & phi5, T const & phi6) { +#ifdef BOOST_NO_STDC_NAMESPACE + using ::cos; + using ::sin; +#else using ::std::cos; using ::std::sin; +#endif //T a = cos(theta)*cos(phi1)*cos(phi2)*cos(phi3)*cos(phi4)*cos(phi5)*cos(phi6); //T b = sin(theta)*cos(phi1)*cos(phi2)*cos(phi3)*cos(phi4)*cos(phi5)*cos(phi6); @@ -3543,8 +3550,13 @@ namespace boost T const & rho4, T const & theta4) { +#ifdef BOOST_NO_STDC_NAMESPACE + using ::cos; + using ::sin; +#else using ::std::cos; using ::std::sin; +#endif T a = rho1*cos(theta1); T b = rho1*sin(theta1); @@ -3569,8 +3581,13 @@ namespace boost T const & h5, T const & h6) { +#ifdef BOOST_NO_STDC_NAMESPACE + using ::cos; + using ::sin; +#else using ::std::cos; using ::std::sin; +#endif T a = r*cos(angle); T b = r*sin(angle); @@ -3582,8 +3599,13 @@ namespace boost template inline octonion exp(octonion const & o) { +#ifdef BOOST_NO_STDC_NAMESPACE + using ::exp; + using ::cos; +#else using ::std::exp; using ::std::cos; +#endif using ::boost::math::sinc_pi; @@ -3604,9 +3626,15 @@ namespace boost template inline octonion cos(octonion const & o) { +#ifdef BOOST_NO_STDC_NAMESPACE + using ::sin; + using ::cos; + using ::cosh; +#else using ::std::sin; using ::std::cos; using ::std::cosh; +#endif using ::boost::math::sinhc_pi; @@ -3625,9 +3653,15 @@ namespace boost template inline octonion sin(octonion const & o) { +#ifdef BOOST_NO_STDC_NAMESPACE + using ::sin; + using ::cos; + using ::cosh; +#else using ::std::sin; using ::std::cos; using ::std::cosh; +#endif using ::boost::math::sinhc_pi; diff --git a/include/boost/math/special_functions/sinc.hpp b/include/boost/math/special_functions/sinc.hpp index 538cf7c5a..818f47bf5 100644 --- a/include/boost/math/special_functions/sinc.hpp +++ b/include/boost/math/special_functions/sinc.hpp @@ -39,9 +39,14 @@ namespace boost template inline T sinc_pi(const T x) { +#ifdef BOOST_NO_STDC_NAMESPACE + using ::abs; + using ::sin; +#else using ::std::abs; using ::std::sin; using ::std::sqrt; +#endif using ::std::numeric_limits; @@ -80,9 +85,11 @@ namespace boost template class U> inline U sinc_pi(const U x) { +#ifndef BOOST_NO_STDC_NAMESPACE using ::std::abs; using ::std::sin; using ::std::sqrt; +#endif using ::std::numeric_limits; diff --git a/include/boost/math/special_functions/sinhc.hpp b/include/boost/math/special_functions/sinhc.hpp index 4ad863852..497755033 100644 --- a/include/boost/math/special_functions/sinhc.hpp +++ b/include/boost/math/special_functions/sinhc.hpp @@ -39,9 +39,14 @@ namespace boost template inline T sinhc_pi(const T x) { +#ifdef BOOST_NO_STDC_NAMESPACE + using ::abs; + using ::sinh; +#else using ::std::abs; using ::std::sinh; using ::std::sqrt; +#endif using ::std::numeric_limits; @@ -80,9 +85,11 @@ namespace boost template class U> inline U sinhc_pi(const U x) { +#ifndef BOOST_NO_STDC_NAMESPACE using ::std::abs; using ::std::sinh; using ::std::sqrt; +#endif using ::std::numeric_limits; diff --git a/octonion/octonion_test.cpp b/octonion/octonion_test.cpp index 8e166a849..9708b23b9 100644 --- a/octonion/octonion_test.cpp +++ b/octonion/octonion_test.cpp @@ -632,15 +632,15 @@ int test_main(int, char *[]) } -#define BOOST_OCTONION_TRENSCENDENTALS_TEST(type) \ +#define BOOST_OCTONION_TRANSCENDENTALS_TEST(type) \ \ ::std::cout << "Testing exp." << std::endl; \ \ for (int idx = 1; idx < 8; ++idx) \ { \ ::boost::math::octonion toto = \ - static_cast(4)*::std::atan(static_cast(1))* \ - index_i_element(idx); \ + static_cast(4)*static_cast(::std::atan( \ + static_cast(1)))*index_i_element(idx); \ \ BOOST_TEST(abs(exp(toto)+static_cast(1)) <= \ 2*numeric_limits::epsilon()); \ @@ -660,7 +660,7 @@ int test_main(int, char *[]) ::std::cout << "Testing " << #type << "." << std::endl; \ \ BOOST_OCTONION_MULTIPLICATION_TEST(type) \ - BOOST_OCTONION_TRENSCENDENTALS_TEST(type) + BOOST_OCTONION_TRANSCENDENTALS_TEST(type) #endif @@ -672,7 +672,7 @@ int test_main(int, char *[]) #undef BOOST_OCTONION_TEST #undef BOOST_OCTONION_MULTIPLICATION_TEST -#undef BOOST_OCTONION_TRENSCENDENTALS_TEST +#undef BOOST_OCTONION_TRANSCENDENTALS_TEST return(::boost::exit_success); } diff --git a/special_functions/special_functions_test.cpp b/special_functions/special_functions_test.cpp index a19e4b000..e91eb84b6 100644 --- a/special_functions/special_functions_test.cpp +++ b/special_functions/special_functions_test.cpp @@ -21,11 +21,12 @@ #ifdef BOOST_NO_STDC_NAMESPACE namespace std { using ::abs; - using ::tanh; + using ::cosh; using ::log; - using ::sinh; using ::sin; + using ::sinh; using ::sqrt; + using ::tanh; } #endif