9#ifndef DRYCHEM_CPP_UNITS_INCLUDE_CPP_UNITS_MATH_BASICMATH_HPP
10#define DRYCHEM_CPP_UNITS_INCLUDE_CPP_UNITS_MATH_BASICMATH_HPP
18#define DECLARE_CMATH_FUNCTION(NAME) \
19 template<int L, int M, int T, int I, int Th, int N, int J> \
20 constexpr auto NAME(const PhysicalQuantity<Dimensionality<L, M, T, I, Th, N, J>>& physicalQuantity) noexcept \
22 return PhysicalQuantity<Dimensionality<L, M, T, I, Th, N, J>>(std::NAME(physicalQuantity.getMagnitude())); \
25#define DECLARE_DIMENSIONLESS_CMATH_FUNCTION(NAME) \
26 template<int L, int M, int T, int I, int Th, int N, int J> \
27 constexpr auto NAME(const PhysicalQuantity<Dimensionality<L, M, T, I, Th, N, J>>& physicalQuantity) noexcept \
29 return PhysicalQuantity<Dimensionality<>>(std::NAME(physicalQuantity.getMagnitude())); \
45 template<
unsigned int Power,
int L,
int M,
int T,
int I,
int Th,
int N,
int J>
54 template<
int L,
int M,
int T,
int I,
int Th,
int N,
int J>
63 template<
int Power,
int L,
int M,
int T,
int I,
int Th,
int N,
int J>
73 template<
int Power,
int L,
int M,
int T,
int I,
int Th,
int N,
int J>
76 if constexpr (
Power >= 0)
82 template<
int L,
int M,
int T,
int I,
int Th,
int N,
int J,
83 typename = std::enable_if_t<(L % 2 == 0) && (M % 2 == 0) && (T % 2 == 0) && (I % 2 == 0) && (Th % 2 == 0)
84 && (N % 2 == 0) && (J % 2 == 0)>>
88 return TReturn {std::sqrt(physicalQuantity.getMagnitude())};
91 template<
int L,
int M,
int T,
int I,
int Th,
int N,
int J,
92 typename = std::enable_if_t<(L % 3 == 0) && (M % 3 == 0) && (T % 3 == 0) && (I % 3 == 0) && (Th % 3 == 0)
93 && (N % 3 == 0) && (J % 3 == 0)>>
97 return TReturn {std::cbrt(physicalQuantity.getMagnitude())};
116#undef DECLARE_CMATH_FUNCTION
117#undef DECLARE_DIMENSIONLESS_CMATH_FUNCTION
Definition physicalQuantity.hpp:33
#define DECLARE_DIMENSIONLESS_CMATH_FUNCTION(NAME)
Definition basicMath.hpp:25
#define DECLARE_CMATH_FUNCTION(NAME)
Definition basicMath.hpp:18
Basic operations.
Definition basicMath.hpp:44
Definition basicMath.hpp:17
constexpr auto sqrt(const PhysicalQuantity< Dimensionality< L, M, T, I, Th, N, J > > &physicalQuantity) noexcept
Definition basicMath.hpp:85
constexpr auto pow(const PhysicalQuantity< Dimensionality< L, M, T, I, Th, N, J > > &physicalQuantity) noexcept
Definition basicMath.hpp:74
constexpr auto cbrt(const PhysicalQuantity< Dimensionality< L, M, T, I, Th, N, J > > &physicalQuantity) noexcept
Definition basicMath.hpp:94
PhysicalQuantity< Dimensionality< 2, 1, -3 > > Power
Definition physicalQuantities.hpp:43
Definition dimensionality.hpp:27
Definition basicMath.hpp:65
static constexpr auto result(const PhysicalQuantity< Dimensionality< L, M, T, I, Th, N, J > > &physicalQuantity) noexcept
Definition basicMath.hpp:66
static constexpr auto result(const PhysicalQuantity< Dimensionality< L, M, T, I, Th, N, J > > &) noexcept
Definition basicMath.hpp:57
Definition basicMath.hpp:47
static constexpr auto result(const PhysicalQuantity< Dimensionality< L, M, T, I, Th, N, J > > &physicalQuantity) noexcept
Definition basicMath.hpp:48