diff --git a/include/boost/math/quaternion.hpp b/include/boost/math/quaternion.hpp index 1bf22033a..7e899c938 100644 --- a/include/boost/math/quaternion.hpp +++ b/include/boost/math/quaternion.hpp @@ -15,15 +15,14 @@ #include // for the "<<" and ">>" operators #include // for the "<<" operator -#ifdef BOOST_NO_STD_LOCALE -#else +#include // for BOOST_NO_STD_LOCALE +#ifndef BOOST_NO_STD_LOCALE #include // for the "<<" operator #endif /* BOOST_NO_STD_LOCALE */ #include -#include #include // for the Sinus cardinal #include // for the Hyperbolic Sinus cardinal diff --git a/include/boost/math/special_functions/sinc.hpp b/include/boost/math/special_functions/sinc.hpp index 33c0083cd..c89cce7f0 100644 --- a/include/boost/math/special_functions/sinc.hpp +++ b/include/boost/math/special_functions/sinc.hpp @@ -12,7 +12,7 @@ #include -#include +#include #include #include @@ -29,16 +29,16 @@ namespace boost #if defined(__GNUC__) && (__GNUC__ < 3) // gcc 2.x ignores function scope using declarations, // put them in the scope of the enclosing namespace instead: - + using ::std::abs; using ::std::sqrt; using ::std::sin; - + using ::std::numeric_limits; #endif /* defined(__GNUC__) && (__GNUC__ < 3) */ - + // This is the "Sinus Cardinal" of index Pi. - + template inline T sinc_pi(const T x) { @@ -51,13 +51,13 @@ namespace boost using ::std::sin; using ::std::sqrt; #endif /* BOOST_NO_STDC_NAMESPACE */ - + using ::std::numeric_limits; - + static T const taylor_0_bound = numeric_limits::epsilon(); static T const taylor_2_bound = sqrt(taylor_0_bound); static T const taylor_n_bound = sqrt(taylor_2_bound); - + if (abs(x) >= taylor_n_bound) { return(sin(x)/x); @@ -66,32 +66,34 @@ namespace boost { // approximation by taylor series in x at 0 up to order 0 T result = static_cast(1); - + if (abs(x) >= taylor_0_bound) { T x2 = x*x; - + // approximation by taylor series in x at 0 up to order 2 result -= x2/static_cast(6); - + if (abs(x) >= taylor_2_bound) { // approximation by taylor series in x at 0 up to order 4 result += (x2*x2)/static_cast(120); } } - + return(result); } } - - + + #ifdef BOOST_NO_TEMPLATE_TEMPLATES #else /* BOOST_NO_TEMPLATE_TEMPLATES */ template class U> inline U sinc_pi(const U x) { -#ifdef BOOST_NO_STDC_NAMESPACE +#if defined(BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL) || defined(__GNUC__) + using namespace std; +#elif defined(BOOST_NO_STDC_NAMESPACE) using ::abs; using ::sin; using ::sqrt; @@ -100,13 +102,13 @@ namespace boost using ::std::sin; using ::std::sqrt; #endif /* BOOST_NO_STDC_NAMESPACE */ - + using ::std::numeric_limits; - + static T const taylor_0_bound = numeric_limits::epsilon(); static T const taylor_2_bound = sqrt(taylor_0_bound); static T const taylor_n_bound = sqrt(taylor_2_bound); - + if (abs(x) >= taylor_n_bound) { return(sin(x)/x); @@ -114,22 +116,22 @@ namespace boost else { // approximation by taylor series in x at 0 up to order 0 - U result = static_cast< U >(1); - + U result = U(1); + if (abs(x) >= taylor_0_bound) { U x2 = x*x; - + // approximation by taylor series in x at 0 up to order 2 result -= x2/static_cast(6); - + if (abs(x) >= taylor_2_bound) { // approximation by taylor series in x at 0 up to order 4 result += (x2*x2)/static_cast(120); } } - + return(result); } } diff --git a/include/boost/math/special_functions/sinhc.hpp b/include/boost/math/special_functions/sinhc.hpp index e8465d138..ce009aebc 100644 --- a/include/boost/math/special_functions/sinhc.hpp +++ b/include/boost/math/special_functions/sinhc.hpp @@ -12,7 +12,7 @@ #include -#include +#include #include #include @@ -29,16 +29,16 @@ namespace boost #if defined(__GNUC__) && (__GNUC__ < 3) // gcc 2.x ignores function scope using declarations, // put them in the scope of the enclosing namespace instead: - + using ::std::abs; using ::std::sqrt; using ::std::sinh; - + using ::std::numeric_limits; #endif /* defined(__GNUC__) && (__GNUC__ < 3) */ - + // This is the "Hyperbolic Sinus Cardinal" of index Pi. - + template inline T sinhc_pi(const T x) { @@ -51,13 +51,13 @@ namespace boost using ::std::sinh; using ::std::sqrt; #endif /* BOOST_NO_STDC_NAMESPACE */ - + using ::std::numeric_limits; - + static T const taylor_0_bound = numeric_limits::epsilon(); static T const taylor_2_bound = sqrt(taylor_0_bound); static T const taylor_n_bound = sqrt(taylor_2_bound); - + if (abs(x) >= taylor_n_bound) { return(sinh(x)/x); @@ -66,32 +66,34 @@ namespace boost { // approximation by taylor series in x at 0 up to order 0 T result = static_cast(1); - + if (abs(x) >= taylor_0_bound) { T x2 = x*x; - + // approximation by taylor series in x at 0 up to order 2 result += x2/static_cast(6); - + if (abs(x) >= taylor_2_bound) { // approximation by taylor series in x at 0 up to order 4 result += (x2*x2)/static_cast(120); } } - + return(result); } } - - + + #ifdef BOOST_NO_TEMPLATE_TEMPLATES #else /* BOOST_NO_TEMPLATE_TEMPLATES */ template class U> inline U sinhc_pi(const U x) { -#ifdef BOOST_NO_STDC_NAMESPACE +#if defined(BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL) || defined(__GNUC__) + using namespace std; +#elif defined(BOOST_NO_STDC_NAMESPACE) using ::abs; using ::sinh; using ::sqrt; @@ -100,13 +102,13 @@ namespace boost using ::std::sinh; using ::std::sqrt; #endif /* BOOST_NO_STDC_NAMESPACE */ - + using ::std::numeric_limits; - + static T const taylor_0_bound = numeric_limits::epsilon(); static T const taylor_2_bound = sqrt(taylor_0_bound); static T const taylor_n_bound = sqrt(taylor_2_bound); - + if (abs(x) >= taylor_n_bound) { return(sinh(x)/x); @@ -114,22 +116,22 @@ namespace boost else { // approximation by taylor series in x at 0 up to order 0 - U result = static_cast< U >(1); - + U result = U(1); + if (abs(x) >= taylor_0_bound) { U x2 = x*x; - + // approximation by taylor series in x at 0 up to order 2 result += x2/static_cast(6); - + if (abs(x) >= taylor_2_bound) { // approximation by taylor series in x at 0 up to order 4 result += (x2*x2)/static_cast(120); } } - + return(result); } }