diff --git a/include/boost/math/special_functions/log1p.hpp b/include/boost/math/special_functions/log1p.hpp index 8121a573c..b3ecf4cba 100644 --- a/include/boost/math/special_functions/log1p.hpp +++ b/include/boost/math/special_functions/log1p.hpp @@ -23,6 +23,7 @@ #include #include #include +#include #if defined(__GNUC__) && defined(BOOST_MATH_USE_FLOAT128) // @@ -293,7 +294,7 @@ const typename log1p_initializer::init log1p_initializer +template inline typename tools::promote_args::type log1p(T x, const Policy&) { typedef typename tools::promote_args::type result_type; @@ -327,7 +328,7 @@ inline typename tools::promote_args::type log1p(T x, const Policy&) #if defined(BOOST_HAS_LOG1P) && !(defined(__osf__) && defined(__DECCXX_VER)) # ifdef BOOST_MATH_USE_C99 -template +template inline float log1p(float x, const Policy& pol) { if(x < -1) @@ -339,7 +340,7 @@ inline float log1p(float x, const Policy& pol) return ::log1pf(x); } #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS -template +template inline long double log1p(long double x, const Policy& pol) { if(x < -1) @@ -352,7 +353,7 @@ inline long double log1p(long double x, const Policy& pol) } #endif #else -template +template inline float log1p(float x, const Policy& pol) { if(x < -1) @@ -364,7 +365,7 @@ inline float log1p(float x, const Policy& pol) return ::log1p(x); } #endif -template +template inline double log1p(double x, const Policy& pol) { if(x < -1) @@ -381,7 +382,7 @@ inline double log1p(double x, const Policy& pol) // that your compilers optimizer won't mess this code up!! // Currently tested with VC8 and Intel 9.1. // -template +template inline double log1p(double x, const Policy& pol) { if(x < -1) @@ -396,7 +397,7 @@ inline double log1p(double x, const Policy& pol) else return ::log(u)*(x/(u-1.0)); } -template +template inline float log1p(float x, const Policy& pol) { return static_cast(boost::math::log1p(static_cast(x), pol)); @@ -406,7 +407,7 @@ inline float log1p(float x, const Policy& pol) // For some reason this fails to compile under WinCE... // Needs more investigation. // -template +template inline long double log1p(long double x, const Policy& pol) { if(x < -1) @@ -424,7 +425,7 @@ inline long double log1p(long double x, const Policy& pol) #endif #endif -template +template inline typename tools::promote_args::type log1p(T x) { return boost::math::log1p(x, policies::policy<>()); @@ -432,7 +433,7 @@ inline typename tools::promote_args::type log1p(T x) // // Compute log(1+x)-x: // -template +template inline typename tools::promote_args::type log1pmx(T x, const Policy& pol) { @@ -464,7 +465,7 @@ inline typename tools::promote_args::type return result; } -template +template inline typename tools::promote_args::type log1pmx(T x) { return log1pmx(x, policies::policy<>()); diff --git a/include/boost/math/special_functions/math_fwd.hpp b/include/boost/math/special_functions/math_fwd.hpp index 6f9d739e1..1ee35473f 100644 --- a/include/boost/math/special_functions/math_fwd.hpp +++ b/include/boost/math/special_functions/math_fwd.hpp @@ -29,6 +29,7 @@ #include #include // for argument promotion. #include +#include #define BOOST_NO_MACRO_EXPAND /**/ @@ -567,17 +568,17 @@ namespace boost typename tools::promote_args::type cbrt(RT z, const Policy&); // log1p is log(x + 1) - template + template typename tools::promote_args::type log1p(T); - template + template typename tools::promote_args::type log1p(T, const Policy&); // log1pmx is log(x + 1) - x - template + template typename tools::promote_args::type log1pmx(T); - template + template typename tools::promote_args::type log1pmx(T, const Policy&); // Exp (x) minus 1 functions.