- Finished unit tests for core math library

- Adjusted formatting
This commit is contained in:
2025-07-02 10:17:35 -04:00
parent 516d9f4977
commit 9010650ceb
16 changed files with 446 additions and 259 deletions

View File

@@ -220,61 +220,27 @@ namespace fennec
/// \name Basic Types
/// @{
///
/// \brief A conditional type
using bool_t = bool;
using bool_t = bool; ///< \brief A conditional type
///
/// \brief A type capable of holding an ascii value
using char_t = char;
using char_t = char; ///< \brief A type capable of holding an ascii value
using schar_t = signed char; ///< \brief A type with the size of a char, capable of holding a signed 8-bit integer
using uchar_t = unsigned char; ///< \brief A type with the size of a char, capable of holding an unsigned 8-bit integer
///
/// \brief A type with the size of a char, capable of holding a signed 8-bit integer
using schar_t = signed char;
using short_t = signed short; ///< \brief A signed short type, capable of holding signed 16-bit integer
using ushort_t = unsigned short; ///< \brief An unsigned short type, capable of holding an unsigned signed 16-bit integer
///
/// \brief A type with the size of a char, capable of holding an unsigned 8-bit integer
using uchar_t = unsigned char;
using int_t = signed int; ///< \brief A signed integer type, size varies by implementation, but typically 32-bit
using uint_t = unsigned int; ///< \brief An unsigned integer type, size varies by implementation, but typically 32-bit
///
/// \brief A signed short type, capable of holding signed 16-bit integer
using short_t = signed short;
using long_t = signed long; ///< \brief A signed integer type, with a size of at least 32-bits
using ulong_t = unsigned long; ///< \brief An unsigned integer type, with a size of at least 32-bits
///
/// \brief An unsigned short type, capable of holding an unsigned signed 16-bit integer
using ushort_t = unsigned short;
using llong_t = signed long long; ///< \brief A signed integer type, with a size of 64-bits
using ullong_t = unsigned long long; ///< \brief An unsigned integer type, with a size of 64-bits
///
/// \brief A signed integer type, size varies by implementation, but typically 32-bit
using int_t = signed int;
using float_t = float; ///< \brief A single-precision floating-point type, typically with a size of 32-bits
using double_t = double; ///< \brief A double-precision floating-point type, typically with a size of 64-bits
///
/// \brief An unsigned integer type, size varies by implementation, but typically 32-bit
using uint_t = unsigned int;
///
/// \brief A signed integer type, with a size of at least 32-bits
using long_t = signed long;
///
/// \brief An unsigned integer type, with a size of at least 32-bits
using ulong_t = unsigned long;
///
/// \brief A signed integer type, with a size of 64-bits
using llong_t = signed long long;
///
/// \brief An unsigned integer type, with a size of 64-bits
using ullong_t = unsigned long long;
///
/// \brief A single-precision floating-point type, typically with a size of 32-bits
using float_t = float;
///
/// \brief A double-point type, typically with a size of 64-bits
using double_t = double;
/// @}
@@ -283,42 +249,17 @@ namespace fennec
/// \name Special Types
/// @{
///
/// \brief Null Pointer Type
using nullptr_t = decltype(nullptr);
///
/// \brief Signed Integer Capable of Holding a Pointer to void
using intptr_t = intptr_t;
using nullptr_t = decltype(nullptr); ///< \brief Null Pointer Type
using intptr_t = intptr_t; ///< \brief Signed Integer Capable of Holding a Pointer to void
using uintptr_t = uintptr_t; ///< \brief Unsigned Integer Capable of Holding a Pointer to void
using intmax_t = __INTMAX_TYPE__; ///< \brief Maximum Width Signed Integer Type
using uintmax_t = __UINTMAX_TYPE__; ///< \brief Maximum Width Unsigned Integer Type
using size_t = __SIZE_TYPE__; ///< \brief Unsigned Integer Type Returned By `sizeof`, `sizeof...`, and `alignof`
using ptrdiff_t = __PTRDIFF_TYPE__; ///< \brief Signed Integer Type Returned by the Subtraction of two Pointers
///
/// \brief Unsigned Integer Capable of Holding a Pointer to void
using uintptr_t = uintptr_t;
///
/// \brief Maximum Width Signed Integer Type
using intmax_t = __INTMAX_TYPE__;
///
/// \brief Maximum Width Unsigned Integer Type
using uintmax_t = __UINTMAX_TYPE__;
///
/// \brief Unsigned Integer Type Returned By `sizeof`, `sizeof...`, and `alignof`
using size_t = __SIZE_TYPE__;
///
/// \brief Signed Integer Type Returned by the Subtraction of two Pointers
using ptrdiff_t = __PTRDIFF_TYPE__;
///
/// \brief undefined class for SFINAE
class undefined_t;
///
/// \brief Void type used for SFINAE
template<typename...>
using void_t = void;
class undefined_t; ///< \brief undefined class for SFINAE
template<typename...> using void_t = void; ///< \brief Void type used for SFINAE
/// @}
}
@@ -334,45 +275,15 @@ namespace fennec
/// \name Sized Integer Types
/// @{
///
/// \brief Signed 8-bit integer
using int8_t = schar_t;
using int8_t = schar_t; ///< \brief Signed 8-bit integer
using int16_t = short_t; ///< \brief Signed 16-bit integer
using int32_t = conditional_t<sizeof(int_t) == 4, int_t, long_t>; ///< \brief Signed 32-bit integer
using int64_t = llong_t; ///< \brief Signed 64-bit integer
///
/// \brief Signed 16-bit integer
using int16_t = short_t;
///
/// \brief Signed 32-bit integer
using int32_t = conditional_t<sizeof(int_t) == 4, int_t, long_t>;
///
/// \brief Signed signed 64-bit integer
using int64_t = llong_t;
/// @}
///
/// \name Sized Unsigned Integer Types
/// @{
///
/// \brief Unsigned 8-bit integer
using uint8_t = uchar_t;
///
/// \brief Unsigned 16-bit integer
using uint16_t = ushort_t;
///
/// \brief Unsigned 32-bit integer
using uint32_t = conditional_t<sizeof(uint_t) == 4, uint_t, ulong_t>;
///
/// \brief Unsigned 64-bit integer
using uint64_t = ullong_t;
using uint8_t = uchar_t; ///< \brief Unsigned 8-bit integer
using uint16_t = ushort_t; ///< \brief Unsigned 16-bit integer
using uint32_t = conditional_t<sizeof(uint_t) == 4, uint_t, ulong_t>; ///< \brief Unsigned 32-bit integer
using uint64_t = ullong_t; ///< \brief Unsigned 64-bit integer
/// @}
@@ -382,13 +293,10 @@ namespace fennec
/// \name Sized Floating-Point Types
/// @{
///
/// \brief A single-precision floating-point scalar
using float32_t = float_t;
using float16_t = _Float16; ///< \brief A half-precision floating-point scalar
using float32_t = _Float32; ///< \brief A single-precision floating-point scalar
using float64_t = _Float64; ///< \brief A double-precision floating-point scalar
///
/// \brief A double-precision floating-point scalar
using float64_t = double_t;
/// @}
}