fix: exp() implementation fixed

This commit is contained in:
Mateusz Pusz
2022-12-19 12:49:15 +01:00
parent 026ce8a4e7
commit a96c34c17a
2 changed files with 3 additions and 1 deletions

View File

@@ -106,7 +106,7 @@ template<Quantity Q>
* @param q Quantity being the base of the operation
* @return Quantity The value of the same quantity type
*/
template<quantity_of<dimensionless> Q, typename Rep>
template<weak_quantity_of<dimensionless> Q>
[[nodiscard]] inline Q exp(const Q& q)
requires requires { exp(q.number()); } || requires { std::exp(q.number()); }
{

View File

@@ -66,6 +66,8 @@ TEST_CASE("'pow<Num, Den>()' on quantity changes the value and the dimension acc
REQUIRE(pow<1, 4>(16 * isq::area[m2]) == sqrt(4 * isq::length[m]));
}
// TODO add tests for exp()
TEST_CASE("absolute functions on quantity returns the absolute value", "[math][abs][fabs]")
{
SECTION("'abs()' on a negative quantity returns the abs")