- Added unit tests and debugged them
This commit is contained in:
@@ -274,8 +274,7 @@
|
||||
///
|
||||
///
|
||||
|
||||
|
||||
#include <cmath>
|
||||
#include <fennec/math/detail/__math.h>
|
||||
|
||||
#include <fennec/math/vector.h>
|
||||
|
||||
@@ -357,7 +356,7 @@ constexpr vector<genType, i...> sign(const vector<genType, i...>& x)
|
||||
/// \param x input value
|
||||
template<typename genType>
|
||||
constexpr genType floor(genType x)
|
||||
{ return std::floor(x); }
|
||||
{ return ::floor(x); }
|
||||
|
||||
|
||||
// Vector Specializations ----------------------------------------------------------------------------------------------
|
||||
@@ -380,7 +379,7 @@ constexpr vector<genType, i...> floor(const vector<genType, i...>& x)
|
||||
/// \param x input value
|
||||
template<typename genType>
|
||||
constexpr genType ceil(genType x)
|
||||
{ return std::ceil(x); }
|
||||
{ return ::ceil(x); }
|
||||
|
||||
|
||||
// Vector Specializations ----------------------------------------------------------------------------------------------
|
||||
@@ -403,7 +402,7 @@ constexpr vector<genType, i...> ceil(const vector<genType, i...>& x)
|
||||
///
|
||||
/// \param x input value
|
||||
template<typename genType> constexpr genType round(genType x)
|
||||
{ return std::round(x); }
|
||||
{ return ::round(x); }
|
||||
|
||||
|
||||
// Vector Specializations ----------------------------------------------------------------------------------------------
|
||||
@@ -451,7 +450,7 @@ constexpr vector<genType, i...> roundEven(const vector<genType, i...>& x)
|
||||
/// \param x input value
|
||||
template<typename genType>
|
||||
constexpr genType trunc(genType x)
|
||||
{ return std::trunc(x); }
|
||||
{ return ::trunc(x); }
|
||||
|
||||
|
||||
// Vector Specializations ----------------------------------------------------------------------------------------------
|
||||
@@ -482,7 +481,7 @@ constexpr vector<genType, i...> trunc(const vector<genType, i...>& x)
|
||||
/// \param x input value
|
||||
template<typename genType>
|
||||
constexpr genType fract(genType x)
|
||||
{ return x - std::floor(x); }
|
||||
{ return x - ::floor(x); }
|
||||
|
||||
|
||||
// Vector Specializations ----------------------------------------------------------------------------------------------
|
||||
@@ -534,7 +533,7 @@ constexpr vector<genType, i...> mod(const vector<genType, i...>& x, const vector
|
||||
/// \param i integral out
|
||||
template<typename genType>
|
||||
constexpr genType modf(genType x, genType& i)
|
||||
{ return std::modf(x, &i); }
|
||||
{ return ::modf(x, &i); }
|
||||
|
||||
|
||||
// Vector Specializations ----------------------------------------------------------------------------------------------
|
||||
@@ -562,7 +561,7 @@ constexpr vector<genType, i...> modf(const vector<genType, i...>& x, vector<genT
|
||||
/// \param x input value
|
||||
template<typename genType, typename genBType = bool_t> requires(is_bool_v<genBType>)
|
||||
constexpr genBType isnan(genType x)
|
||||
{ return std::isnan(x); }
|
||||
{ return ::isnan(x); }
|
||||
|
||||
|
||||
// Vector Specializations ----------------------------------------------------------------------------------------------
|
||||
@@ -585,7 +584,7 @@ constexpr vector<genBType, i...> isnan(const vector<genType, i...>& x)
|
||||
/// \param x input value
|
||||
template<typename genType, typename genBType = bool_t> requires(is_bool_v<genBType>)
|
||||
constexpr genBType isinf(genType x)
|
||||
{ return std::isinf(x); }
|
||||
{ return ::isinf(x); }
|
||||
|
||||
|
||||
// Vector Specializations ----------------------------------------------------------------------------------------------
|
||||
@@ -684,7 +683,7 @@ constexpr vector<genType, i...> uintBitsToFloat(const vector<genUType, i...>& x)
|
||||
/// \param c the addend
|
||||
template<typename genType>
|
||||
constexpr genType fma(genType a, genType b, genType c)
|
||||
{ return std::fma(a, b, c); }
|
||||
{ return ::fma(a, b, c); }
|
||||
|
||||
|
||||
// Vector Specializations ----------------------------------------------------------------------------------------------
|
||||
@@ -713,7 +712,7 @@ constexpr vector<genType, i...> fma(const vector<genType, i...>& a, const vector
|
||||
/// \param exp The variable to store the exponent in
|
||||
template<typename genType, typename genIType = int_t> requires(is_integral_v<genIType>)
|
||||
constexpr genType frexp(genType x, genIType& exp)
|
||||
{ return std::frexp(x, &exp); }
|
||||
{ return ::frexp(x, &exp); }
|
||||
|
||||
|
||||
// Vector Specializations ----------------------------------------------------------------------------------------------
|
||||
@@ -744,7 +743,7 @@ constexpr vector<genType, i...> frexp(const vector<genType, i...>& x, vector<gen
|
||||
/// \param exp The exponent
|
||||
template<typename genType, typename genIType = int_t> requires(is_integral_v<genIType>)
|
||||
constexpr genType ldexp(genType x, genIType exp)
|
||||
{ return std::ldexp(x, exp); }
|
||||
{ return ::ldexp(x, exp); }
|
||||
|
||||
|
||||
// Vector Specializations ----------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user