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

workaround for no c++11 numeric_limits

This commit is contained in:
bolero-MURAKAMI 2013-08-07 00:15:09 +09:00
parent ce16e24637
commit 7a1974742a
110 changed files with 727 additions and 436 deletions

View file

@ -1,9 +1,9 @@
#ifndef SPROUT_MATH_FMA_HPP
#define SPROUT_MATH_FMA_HPP
#include <limits>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/limits.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/isnan.hpp>
#include <sprout/math/isinf.hpp>
@ -23,10 +23,10 @@ namespace sprout {
return sprout::math::isnan(x) ? x
: sprout::math::isnan(y) ? y
: sprout::math::isnan(z) ? z
: sprout::math::isinf(x) && y == 0 ? std::numeric_limits<FloatType>::quiet_NaN()
: sprout::math::isinf(y) && x == 0 ? std::numeric_limits<FloatType>::quiet_NaN()
: sprout::math::isinf(x) && y == 0 ? sprout::numeric_limits<FloatType>::quiet_NaN()
: sprout::math::isinf(y) && x == 0 ? sprout::numeric_limits<FloatType>::quiet_NaN()
: (sprout::math::isinf(x) || sprout::math::isinf(y)) && sprout::math::isinf(z) && (sprout::math::signbit(x) ^ sprout::math::signbit(y) ^ sprout::math::signbit(z))
? std::numeric_limits<FloatType>::quiet_NaN()
? sprout::numeric_limits<FloatType>::quiet_NaN()
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
: std::fma(x, y, z)
#else