mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-05 13:14:29 +02:00
@@ -74,14 +74,15 @@ template<Quantity Q>
|
|||||||
/**
|
/**
|
||||||
* @brief Computes Euler's raised to the given power
|
* @brief Computes Euler's raised to the given power
|
||||||
*
|
*
|
||||||
|
* @note Such an operation has sense only for a dimensionless quantity.
|
||||||
|
*
|
||||||
* @param q Quantity being the base of the operation
|
* @param q Quantity being the base of the operation
|
||||||
* @return Quantity The value of the same quantity type
|
* @return Quantity The value of the same quantity type
|
||||||
*/
|
*/
|
||||||
template<typename D, typename U, typename Rep>
|
template<typename U, typename Rep>
|
||||||
[[nodiscard]] inline quantity<D, U, Rep> exp(const quantity<D, U, Rep>& q)
|
[[nodiscard]] inline dimensionless<U, Rep> exp(const dimensionless<U, Rep>& q)
|
||||||
{
|
{
|
||||||
using coherent_unit = dimension_unit<D>;
|
return quantity_cast<U>(dimensionless<one, Rep>(std::exp(quantity_cast<one>(q).count())));
|
||||||
return quantity_cast<U>(quantity<D, coherent_unit, Rep>(std::exp(quantity_cast<coherent_unit>(q).count())));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user