fix math::log implementation

support std::hash
This commit is contained in:
bolero-MURAKAMI 2013-02-07 03:11:17 +09:00
parent 9140b68379
commit 66da9f4fea
20 changed files with 288 additions and 5 deletions

View file

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