mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-16 15:14:13 +00:00
add math::copysign
fix hyperbolic and exponental functions: for special values
This commit is contained in:
parent
a27c83e939
commit
32c3ba02d4
50 changed files with 540 additions and 216 deletions
|
@ -10,6 +10,7 @@
|
|||
#include <sprout/math/detail/float_compute.hpp>
|
||||
#include <sprout/math/constants.hpp>
|
||||
#include <sprout/math/factorial.hpp>
|
||||
#include <sprout/math/copysign.hpp>
|
||||
#include <sprout/math/fabs.hpp>
|
||||
#include <sprout/math/sqrt.hpp>
|
||||
#include <sprout/type_traits/enabler_if.hpp>
|
||||
|
@ -48,7 +49,7 @@ namespace sprout {
|
|||
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
|
||||
: std::asin(x)
|
||||
#else
|
||||
: x == 0 ? FloatType(0)
|
||||
: x == 0 ? sprout::math::copysign(FloatType(0), x)
|
||||
: static_cast<FloatType>(
|
||||
x < 0 ? -sprout::math::detail::asin_impl(static_cast<typename sprout::math::detail::float_compute<FloatType>::type>(-x))
|
||||
: sprout::math::detail::asin_impl(static_cast<typename sprout::math::detail::float_compute<FloatType>::type>(x))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue