add math::copysign

fix hyperbolic and exponental functions: for special values
This commit is contained in:
bolero-MURAKAMI 2013-04-24 22:48:36 +09:00
parent a27c83e939
commit 32c3ba02d4
50 changed files with 540 additions and 216 deletions

View file

@ -4,6 +4,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/copysign.hpp>
#include <sprout/type_traits/enabler_if.hpp>
namespace sprout {
@ -15,9 +16,8 @@ namespace sprout {
>
inline SPROUT_CONSTEXPR FloatType
fabs(FloatType x) {
return x < 0 ? -x : x;
return sprout::math::copysign(x, FloatType(0));
}
template<
typename IntType,
typename sprout::enabler_if<std::is_integral<IntType>::value>::type = sprout::enabler