forked from mpusz/mp-units
refactor: quantity::value() renamed to quantity::numerical_value()
According to https://jcgm.bipm.org/vim/en/1.19.html "quantity value" also contains a unit. According to https://jcgm.bipm.org/vim/en/1.20.html "numerical value" is the correct term for just a number. Resolves #423
This commit is contained in:
@@ -75,14 +75,15 @@ template<Unit auto From, Unit auto To>
|
||||
template<ReferenceOf<currency> auto To, ReferenceOf<currency> auto From, typename Rep>
|
||||
quantity<To, Rep> exchange_to(quantity<From, Rep> q)
|
||||
{
|
||||
return static_cast<Rep>(exchange_rate<q.unit, get_unit(To)>() * q.value()) * To;
|
||||
return static_cast<Rep>(exchange_rate<q.unit, get_unit(To)>() * q.numerical_value()) * To;
|
||||
}
|
||||
|
||||
template<ReferenceOf<currency> auto To, ReferenceOf<currency> auto From, auto PO, typename Rep>
|
||||
quantity_point<To, PO, Rep> exchange_to(quantity_point<From, PO, Rep> q)
|
||||
{
|
||||
return quantity_point{
|
||||
zero + static_cast<Rep>(exchange_rate<q.unit, get_unit(To)>() * (q - q.absolute_point_origin).value()) * To};
|
||||
zero +
|
||||
static_cast<Rep>(exchange_rate<q.unit, get_unit(To)>() * (q - q.absolute_point_origin).numerical_value()) * To};
|
||||
}
|
||||
|
||||
int main()
|
||||
|
||||
Reference in New Issue
Block a user