fix math::exp implementation

This commit is contained in:
bolero-MURAKAMI 2013-02-07 03:32:05 +09:00
parent 66da9f4fea
commit 4b3d4e82d7
2 changed files with 12 additions and 10 deletions

View file

@ -42,7 +42,7 @@ namespace sprout {
typedef double type;
return x == 0 ? std::numeric_limits<FloatType>::quiet_NaN()
: !(x > 0) ? -std::numeric_limits<FloatType>::infinity()
: x < 1 ? static_cast<FloatType>(-sprout::math::detail::log_impl(type(1) / static_cast<type>(x)))
: x < 1 ? static_cast<FloatType>(-sprout::math::detail::log_impl(1 / static_cast<type>(x)))
: static_cast<FloatType>(sprout::math::detail::log_impl(static_cast<type>(x)))
;
}