From 814eb046499fd4b8cb3da93d4e4d19d01ae811cb Mon Sep 17 00:00:00 2001 From: Jonathan Rampersad Date: Sat, 1 Jun 2024 22:51:45 -0400 Subject: [PATCH] Template helper functions updated ABS, NEGATE AND POW now accept floating point types along with integral types --- Exponential/Exponential.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Exponential/Exponential.h b/Exponential/Exponential.h index 436be5b..e56ae95 100644 --- a/Exponential/Exponential.h +++ b/Exponential/Exponential.h @@ -39,21 +39,21 @@ namespace JRAMPERSAD template [[nodiscard("MATH::ABS(T) returns a value of type T")]] T ABS(const T& n) noexcept { - static_assert(std::is_integral::value, "Integral required."); + static_assert(std::is_arithmetic::value, "Arithmetic type required."); return n < 0 ? n * -1 : n; } template [[nodiscard("MATH::NEGATE(T) returns a value of type T")]] T NEGATE(const T& n) noexcept { - static_assert(std::is_integral::value, "Integral required."); + static_assert(std::is_arithmetic::value, "Arithmetic type required."); return n * -1; } template [[nodiscard("MATH::POW(T, int) returns a value of type T")]] T POW(const T& n, const int& exp) noexcept { - static_assert(std::is_integral::value, "Integral required."); + static_assert(std::is_arithmetic::value, "Arithmetic type required."); if (exp == 0) return 1;