|
|
|
|
@ -251,7 +251,8 @@ template<std::size_t size, class T> Vector<size, T> floor(const Vector<size, T>&
|
|
|
|
|
template<class T> inline T round(const T& a); |
|
|
|
|
#else |
|
|
|
|
template<class T> inline typename std::enable_if<std::is_arithmetic<T>::value, T>::type round(T a) { |
|
|
|
|
#ifndef CORRADE_TARGET_NACL_NEWLIB |
|
|
|
|
/** @todo Remove when newlib has this fixed */ |
|
|
|
|
#if !defined(CORRADE_TARGET_NACL_NEWLIB) && !defined(CORRADE_TARGET_ANDROID) |
|
|
|
|
return std::round(a); |
|
|
|
|
#else |
|
|
|
|
return (a > T(0)) ? std::floor(a + T(0.5)) : std::ceil(a - T(0.5)); |
|
|
|
|
@ -260,7 +261,7 @@ template<class T> inline typename std::enable_if<std::is_arithmetic<T>::value, T
|
|
|
|
|
template<std::size_t size, class T> Vector<size, T> round(const Vector<size, T>& a) { |
|
|
|
|
Vector<size, T> out; |
|
|
|
|
for(std::size_t i = 0; i != size; ++i) { |
|
|
|
|
#ifndef CORRADE_TARGET_NACL_NEWLIB |
|
|
|
|
#if !defined(CORRADE_TARGET_NACL_NEWLIB) && !defined(CORRADE_TARGET_ANDROID) |
|
|
|
|
out[i] = std::round(a[i]); |
|
|
|
|
#else |
|
|
|
|
out[i] = round(a[i]); |
|
|
|
|
@ -396,8 +397,8 @@ Computes and returns @f$ ab + c @f$.
|
|
|
|
|
template<class T> inline T fma(const T& a, const T& b, const T& c); |
|
|
|
|
#else |
|
|
|
|
template<class T> inline typename std::enable_if<std::is_arithmetic<T>::value, T>::type fma(T a, T b, T c) { |
|
|
|
|
/** @todo Remove when NaCl's newlib has this fixed */ |
|
|
|
|
#ifndef CORRADE_TARGET_NACL_NEWLIB |
|
|
|
|
/** @todo Remove when newlib has this fixed */ |
|
|
|
|
#if !defined(CORRADE_TARGET_NACL_NEWLIB) && !defined(CORRADE_TARGET_ANDROID) |
|
|
|
|
return std::fma(a, b, c); |
|
|
|
|
#else |
|
|
|
|
return a*b + c; |
|
|
|
|
|