mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-16 15:14:13 +00:00
fix math functions
This commit is contained in:
parent
2e2b6c96ab
commit
ffb876c930
23 changed files with 85 additions and 37 deletions
|
@ -7,6 +7,7 @@
|
|||
#include <sprout/math/detail/config.hpp>
|
||||
#include <sprout/math/detail/float_compute.hpp>
|
||||
#include <sprout/math/constants.hpp>
|
||||
#include <sprout/math/isnan.hpp>
|
||||
#include <sprout/math/cos.hpp>
|
||||
#include <sprout/type_traits/enabler_if.hpp>
|
||||
|
||||
|
@ -25,9 +26,9 @@ namespace sprout {
|
|||
>
|
||||
inline SPROUT_CONSTEXPR FloatType
|
||||
sin(FloatType x) {
|
||||
return x == std::numeric_limits<FloatType>::infinity()
|
||||
|| x == -std::numeric_limits<FloatType>::infinity()
|
||||
? std::numeric_limits<FloatType>::quiet_NaN()
|
||||
return sprout::math::isnan(x) ? x
|
||||
: x == std::numeric_limits<FloatType>::infinity() || x == -std::numeric_limits<FloatType>::infinity()
|
||||
? -std::numeric_limits<FloatType>::quiet_NaN()
|
||||
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
|
||||
: std::sin(x)
|
||||
#else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue