- Finished Vector Tests (test_vector.h)

This commit is contained in:
2025-06-26 09:34:23 -04:00
parent cbaf69310e
commit 37fba8faad
3 changed files with 158 additions and 28 deletions

View File

@@ -61,15 +61,15 @@
#define CHAR_MIN 0xffffff80
#define CHAR_MAX 0x7f
#define WCHAR_IS_SIGNED false
#define WCHAR_IS_SIGNED true
#define WCHAR_ROUNDS 0x0
#define WCHAR_RADIX_DIG 0x10
#define WCHAR_DIG 0x4
#define WCHAR_RADIX_DIG 0x1f
#define WCHAR_DIG 0x9
#define WCHAR_DECIMAL_DIG 0x0
#define WCHAR_RADIX 0x2
#define WCHAR_TRAPS 0xtrue
#define WCHAR_MIN 0x0
#define WCHAR_MAX 0xffff
#define WCHAR_MIN 0x80000000
#define WCHAR_MAX 0x7fffffff
#define SCHAR_ROUNDS 0x0
#define SCHAR_RADIX_DIG 0x7
@@ -126,22 +126,22 @@
#define UINT_MAX 0xffffffff
#define LONG_ROUNDS 0x0
#define LONG_RADIX_DIG 0x1f
#define LONG_DIG 0x9
#define LONG_RADIX_DIG 0x3f
#define LONG_DIG 0x12
#define LONG_DECIMAL_DIG 0x0
#define LONG_RADIX 0x2
#define LONG_TRAPS 0xtrue
#define LONG_MIN 0x80000000
#define LONG_MAX 0x7fffffff
#define LONG_MIN 0x8000000000000000
#define LONG_MAX 0x7fffffffffffffff
#define ULONG_ROUNDS 0x0
#define ULONG_RADIX_DIG 0x20
#define ULONG_DIG 0x9
#define ULONG_RADIX_DIG 0x40
#define ULONG_DIG 0x13
#define ULONG_DECIMAL_DIG 0x0
#define ULONG_RADIX 0x2
#define ULONG_TRAPS 0xtrue
#define ULONG_MIN 0x0
#define ULONG_MAX 0xffffffff
#define ULONG_MAX 0xffffffffffffffff
#define LLONG_ROUNDS 0x0
#define LLONG_RADIX_DIG 0x3f

View File

@@ -848,7 +848,7 @@ struct vector : detail::vector_base_type<ScalarT, sizeof...(IndicesV)>
/// \param rhs Right Hand Side of the Expression
/// \returns A \ref fennec_math_vector "vector" \a v such that, \f$v_i=lhs_i|rhs_i\f$
constexpr friend vector_t operator|(scalar_t rhs, const vector_t& lhs) requires(is_integral_v<scalar_t>)
{ return vector_t((lhs & rhs[IndicesV]) ...); }
{ return vector_t((lhs[IndicesV] | rhs) ...); }
///
/// \brief \ref fennec_math_vector "vector" - \ref fennec_math_scalar "scalar" bitwise or operator
@@ -888,7 +888,7 @@ struct vector : detail::vector_base_type<ScalarT, sizeof...(IndicesV)>
/// \param rhs Right Hand Side of the Expression
/// \returns A \ref fennec_math_vector "vector" \a v such that, \f$v_i=lhs_i|rhs_i\f$
constexpr friend vector_t operator|=(vector_t& lhs, const vector_t& rhs) requires(is_integral_v<scalar_t>)
{ return ((lhs[IndicesV] |= rhs), ..., lhs); }
{ return ((lhs[IndicesV] |= rhs[IndicesV]), ..., lhs); }
@@ -897,7 +897,7 @@ struct vector : detail::vector_base_type<ScalarT, sizeof...(IndicesV)>
/// \param lhs Left Hand Side of the Expression
/// \param rhs Right Hand Side of the Expression
/// \returns A \ref fennec_math_vector "vector" \a v such that, \f$v_i=lhs_i\^rhs_i\f$
constexpr friend vector_t operator^(scalar_t rhs, const vector_t& lhs) requires(is_integral_v<scalar_t>)
constexpr friend vector_t operator^(scalar_t lhs, const vector_t& rhs) requires(is_integral_v<scalar_t>)
{ return vector_t((lhs ^ rhs[IndicesV]) ...); }
///
@@ -930,12 +930,20 @@ struct vector : detail::vector_base_type<ScalarT, sizeof...(IndicesV)>
/// \param rhs Right Hand Side of the Expression
/// \returns A \ref fennec_math_vector "vector" \a v such that, \f$v_i=lhs_i\^rhs_i\f$
constexpr friend vector_t operator^=(vector_t& lhs, const vector_t& rhs) requires(is_integral_v<scalar_t>)
{ return ((lhs[IndicesV] ^= rhs), ..., lhs); }
{ return ((lhs[IndicesV] ^= rhs[IndicesV]), ..., lhs); }
///
/// \ref fennec_math_vector "vector" - \ref fennec_math_scalar "scalar" bitwise or operator
/// \ref fennec_math_scalar "scalar" - \ref fennec_math_vector "vector" bitwise left-shift operator
/// \param lhs Left Hand Side of the Expression
/// \param rhs Right Hand Side of the Expression
/// \returns A \ref fennec_math_vector "vector" \a v such that, \f$v_i=lhs_i<<rhs_i\f$
constexpr friend vector_t operator<<(scalar_t lhs, const vector_t& rhs) requires(is_integral_v<scalar_t>)
{ return vector_t((lhs << rhs[IndicesV]) ...); }
///
/// \ref fennec_math_vector "vector" - \ref fennec_math_scalar "scalar" bitwise left-shift operator
/// \param lhs Left Hand Side of the Expression
/// \param rhs Right Hand Side of the Expression
/// \returns A \ref fennec_math_vector "vector" \a v such that, \f$v_i=lhs_i<<rhs_i\f$
@@ -964,10 +972,18 @@ struct vector : detail::vector_base_type<ScalarT, sizeof...(IndicesV)>
/// \param rhs Right Hand Side of the Expression
/// \returns A \ref fennec_math_vector "vector" \a v such that, \f$v_i=lhs_i<<=rhs_i\f$
constexpr friend vector_t operator<<=(vector_t& lhs, const vector_t& rhs) requires(is_integral_v<scalar_t>)
{ return ((lhs[IndicesV] <<= rhs), ..., lhs); }
{ return ((lhs[IndicesV] <<= rhs[IndicesV]), ..., lhs); }
///
/// \ref fennec_math_scalar "scalar" - \ref fennec_math_vector "vector" bitwise or operator
/// \param lhs Left Hand Side of the Expression
/// \param rhs Right Hand Side of the Expression
/// \returns A \ref fennec_math_vector "vector" \a v such that, \f$v_i=lhs_i>>rhs_i\f$
constexpr friend vector_t operator>>(scalar_t lhs, const vector_t& rhs) requires(is_integral_v<scalar_t>)
{ return vector_t((lhs >> rhs[IndicesV]) ...); }
///
/// \ref fennec_math_vector "vector" - \ref fennec_math_scalar "scalar" bitwise or operator
/// \param lhs Left Hand Side of the Expression
@@ -998,7 +1014,7 @@ struct vector : detail::vector_base_type<ScalarT, sizeof...(IndicesV)>
/// \param rhs Right Hand Side of the Expression
/// \returns A \ref fennec_math_vector "vector" \a v such that, \f$v_i=lhs_i>>=rhs_i\f$
constexpr friend vector_t operator>>=(vector_t& lhs, const vector_t& rhs) requires(is_integral_v<scalar_t>)
{ return ((lhs[IndicesV] >>= rhs), ..., lhs); }
{ return ((lhs[IndicesV] >>= rhs[IndicesV]), ..., lhs); }
/// @}