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

add sprout::cbrt, hypot, fmax, fmin, fdim

fix sprout::pow case x==0
This commit is contained in:
bolero-MURAKAMI 2012-05-05 18:50:17 +09:00
parent feba220da4
commit 6ccd6e1cf4
10 changed files with 273 additions and 17 deletions

View file

@ -21,7 +21,9 @@ namespace sprout {
>
inline SPROUT_CONSTEXPR FloatType
pow(FloatType x, FloatType y) {
return sprout::math::detail::exp(y * sprout::math::detail::log(x));
return x == 0 && y > 0 ? FloatType(0)
: sprout::math::detail::exp(y * sprout::math::detail::log(x))
;
}
template<