1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2025-08-03 12:49:50 +00:00

fix math implementation.

This commit is contained in:
bolero-MURAKAMI 2012-06-23 13:22:50 +09:00
parent 3500d0d49c
commit 1636398742
49 changed files with 227 additions and 456 deletions

View file

@ -4,9 +4,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
#include <sprout/math/detail/config.hpp>
namespace sprout {
namespace math {
@ -27,12 +25,7 @@ namespace sprout {
>
inline SPROUT_CONSTEXPR FloatType
abs(FloatType x) {
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::abs;
# else
using sprout::math::detail::abs;
# endif
return abs(x);
return NS_SPROUT_MATH_DETAIL::abs(x);
}
} // namespace math

View file

@ -3,12 +3,10 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/asin.hpp>
#include <sprout/math/constants.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -32,11 +30,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::acos;
# else
using sprout::math::detail::acos;
# endif
using NS_SPROUT_MATH_DETAIL::acos;
} // namespace math
using sprout::math::acos;

View file

@ -4,12 +4,10 @@
#include <limits>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/log.hpp>
#include <sprout/math/sqrt.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -36,11 +34,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::acosh;
# else
using sprout::math::detail::acosh;
# endif
using NS_SPROUT_MATH_DETAIL::acosh;
} // namespace math
using sprout::math::acosh;

View file

@ -5,13 +5,11 @@
#include <limits>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/constants.hpp>
#include <sprout/math/factorial.hpp>
#include <sprout/math/sqrt.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -75,11 +73,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::asin;
# else
using sprout::math::detail::asin;
# endif
using NS_SPROUT_MATH_DETAIL::asin;
} // namespace math
using sprout::math::asin;

View file

@ -4,12 +4,10 @@
#include <limits>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/log.hpp>
#include <sprout/math/sqrt.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -36,11 +34,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::asinh;
# else
using sprout::math::detail::asinh;
# endif
using NS_SPROUT_MATH_DETAIL::asinh;
} // namespace math
using sprout::math::asinh;

View file

@ -4,12 +4,10 @@
#include <cstddef>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/constants.hpp>
#include <sprout/math/factorial.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -70,11 +68,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::atan;
# else
using sprout::math::detail::atan;
# endif
using NS_SPROUT_MATH_DETAIL::atan;
} // namespace math
using sprout::math::atan;

View file

@ -3,13 +3,11 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/atan.hpp>
#include <sprout/math/constants.hpp>
#include <sprout/math/float_promote.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -40,11 +38,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::atan2;
# else
using sprout::math::detail::atan2;
# endif
using NS_SPROUT_MATH_DETAIL::atan2;
} // namespace math
using sprout::math::atan2;

View file

@ -4,11 +4,9 @@
#include <limits>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/log.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -36,11 +34,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::atanh;
# else
using sprout::math::detail::atanh;
# endif
using NS_SPROUT_MATH_DETAIL::atanh;
} // namespace math
using sprout::math::atanh;

View file

@ -3,12 +3,10 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/pow.hpp>
#include <sprout/math/constants.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -34,11 +32,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::cbrt;
# else
using sprout::math::detail::cbrt;
# endif
using NS_SPROUT_MATH_DETAIL::cbrt;
} // namespace math
using sprout::math::cbrt;

View file

@ -5,11 +5,9 @@
#include <limits>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/factorial.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -56,11 +54,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::cos;
# else
using sprout::math::detail::cos;
# endif
using NS_SPROUT_MATH_DETAIL::cos;
} // namespace math
using sprout::math::cos;

View file

@ -4,11 +4,9 @@
#include <cstddef>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/factorial.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -51,11 +49,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::cosh;
# else
using sprout::math::detail::cosh;
# endif
using NS_SPROUT_MATH_DETAIL::cosh;
} // namespace math
using sprout::math::cosh;

View file

@ -0,0 +1,15 @@
#ifndef SPROUT_MATH_DETAIL_CONFIG_HPP
#define SPROUT_MATH_DETAIL_CONFIG_HPP
#include <sprout/config.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# define NS_SPROUT_MATH_DETAIL std
#else // #ifndef SPROUT_USE_BUILTIN_CMATH_FUNCTION
# define NS_SPROUT_MATH_DETAIL sprout::math::detail
#endif // #ifndef SPROUT_USE_BUILTIN_CMATH_FUNCTION
#endif // #ifndef SPROUT_MATH_DETAIL_CONFIG_HPP

View file

@ -4,11 +4,9 @@
#include <cstddef>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/factorial.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -51,11 +49,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::exp;
# else
using sprout::math::detail::exp;
# endif
using NS_SPROUT_MATH_DETAIL::exp;
} // namespace math
using sprout::math::exp;

View file

@ -3,12 +3,10 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/exp.hpp>
#include <sprout/math/constants.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -32,11 +30,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::exp2;
# else
using sprout::math::detail::exp2;
# endif
using NS_SPROUT_MATH_DETAIL::exp2;
} // namespace math
using sprout::math::exp2;

View file

@ -3,12 +3,10 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/exp.hpp>
#include <sprout/math/constants.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -32,11 +30,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::expm1;
# else
using sprout::math::detail::expm1;
# endif
using NS_SPROUT_MATH_DETAIL::expm1;
} // namespace math
using sprout::math::expm1;

View file

@ -3,10 +3,8 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -30,11 +28,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::fabs;
# else
using sprout::math::detail::fabs;
# endif
using NS_SPROUT_MATH_DETAIL::fabs;
} // namespace math
using sprout::math::fabs;

View file

@ -3,11 +3,9 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/float_promote.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -35,11 +33,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::fdim;
# else
using sprout::math::detail::fdim;
# endif
using NS_SPROUT_MATH_DETAIL::fdim;
} // namespace math
using sprout::math::fdim;

View file

@ -3,11 +3,9 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/float_promote.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -42,11 +40,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::fma;
# else
using sprout::math::detail::fma;
# endif
using NS_SPROUT_MATH_DETAIL::fma;
} // namespace math
using sprout::math::fma;

View file

@ -3,11 +3,9 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/float_promote.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -35,11 +33,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::fmax;
# else
using sprout::math::detail::fmax;
# endif
using NS_SPROUT_MATH_DETAIL::fmax;
} // namespace math
using sprout::math::fmax;

View file

@ -3,11 +3,9 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/float_promote.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -35,11 +33,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::fmin;
# else
using sprout::math::detail::fmin;
# endif
using NS_SPROUT_MATH_DETAIL::fmin;
} // namespace math
using sprout::math::fmin;

View file

@ -5,6 +5,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/isnan.hpp>
#include <sprout/math/isinf.hpp>
#include <sprout/math/iszero.hpp>
@ -28,11 +29,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::fpclassify;
# else
using sprout::math::detail::fpclassify;
# endif
using NS_SPROUT_MATH_DETAIL::fpclassify;
} // namespace math
using sprout::math::fpclassify;

View file

@ -3,12 +3,10 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/float_promote.hpp>
#include <sprout/math/sqrt.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -36,11 +34,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::hypot;
# else
using sprout::math::detail::hypot;
# endif
using NS_SPROUT_MATH_DETAIL::hypot;
} // namespace math
using sprout::math::hypot;

View file

@ -4,11 +4,9 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/isnan.hpp>
#include <sprout/math/isinf.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -25,11 +23,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::isfinite;
# else
using sprout::math::detail::isfinite;
# endif
using NS_SPROUT_MATH_DETAIL::isfinite;
} // namespace math
using sprout::math::isfinite;

View file

@ -4,10 +4,8 @@
#include <limits>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -24,11 +22,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::isinf;
# else
using sprout::math::detail::isinf;
# endif
using NS_SPROUT_MATH_DETAIL::isinf;
} // namespace math
using sprout::math::isinf;

View file

@ -3,10 +3,8 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -21,11 +19,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::isnan;
# else
using sprout::math::detail::isnan;
# endif
using NS_SPROUT_MATH_DETAIL::isnan;
} // namespace math
using sprout::math::isnan;

View file

@ -4,12 +4,10 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/isnan.hpp>
#include <sprout/math/isinf.hpp>
#include <sprout/math/issubnormal.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -27,11 +25,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::isnormal;
# else
using sprout::math::detail::isnormal;
# endif
using NS_SPROUT_MATH_DETAIL::isnormal;
} // namespace math
using sprout::math::isnormal;

View file

@ -5,13 +5,11 @@
#include <limits>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/constants.hpp>
#include <sprout/math/factorial.hpp>
#include <sprout/math/sqrt.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -69,11 +67,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::log;
# else
using sprout::math::detail::log;
# endif
using NS_SPROUT_MATH_DETAIL::log;
} // namespace math
using sprout::math::log;

View file

@ -3,12 +3,10 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/log.hpp>
#include <sprout/math/constants.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -32,11 +30,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::log10;
# else
using sprout::math::detail::log10;
# endif
using NS_SPROUT_MATH_DETAIL::log10;
} // namespace math
using sprout::math::log10;

View file

@ -3,11 +3,9 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/log.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -31,11 +29,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::log1p;
# else
using sprout::math::detail::log1p;
# endif
using NS_SPROUT_MATH_DETAIL::log1p;
} // namespace math
using sprout::math::log1p;

View file

@ -3,12 +3,10 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/log.hpp>
#include <sprout/math/constants.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -32,11 +30,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::log2;
# else
using sprout::math::detail::log2;
# endif
using NS_SPROUT_MATH_DETAIL::log2;
} // namespace math
using sprout::math::log2;

View file

@ -3,14 +3,12 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/exp.hpp>
#include <sprout/math/log.hpp>
#include <sprout/math/constants.hpp>
#include <sprout/math/float_promote.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -40,11 +38,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::pow;
# else
using sprout::math::detail::pow;
# endif
using NS_SPROUT_MATH_DETAIL::pow;
} // namespace math
using sprout::math::pow;

View file

@ -3,10 +3,8 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -21,11 +19,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::signbit;
# else
using sprout::math::detail::signbit;
# endif
using NS_SPROUT_MATH_DETAIL::signbit;
} // namespace math
using sprout::math::signbit;

View file

@ -3,12 +3,10 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/cos.hpp>
#include <sprout/math/constants.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -32,11 +30,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::sin;
# else
using sprout::math::detail::sin;
# endif
using NS_SPROUT_MATH_DETAIL::sin;
} // namespace math
using sprout::math::sin;

View file

@ -4,11 +4,9 @@
#include <cstddef>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/factorial.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -51,11 +49,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::sinh;
# else
using sprout::math::detail::sinh;
# endif
using NS_SPROUT_MATH_DETAIL::sinh;
} // namespace math
using sprout::math::sinh;

View file

@ -4,10 +4,8 @@
#include <limits>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -59,11 +57,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::sqrt;
# else
using sprout::math::detail::sqrt;
# endif
using NS_SPROUT_MATH_DETAIL::sqrt;
} // namespace math
using sprout::math::sqrt;

View file

@ -3,12 +3,10 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/sin.hpp>
#include <sprout/math/cos.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -32,11 +30,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::tan;
# else
using sprout::math::detail::tan;
# endif
using NS_SPROUT_MATH_DETAIL::tan;
} // namespace math
using sprout::math::tan;

View file

@ -3,12 +3,10 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/sinh.hpp>
#include <sprout/math/cosh.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout {
namespace math {
@ -32,11 +30,7 @@ namespace sprout {
}
} // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::tanh;
# else
using sprout::math::detail::tanh;
# endif
using NS_SPROUT_MATH_DETAIL::tanh;
} // namespace math
using sprout::math::tanh;