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:
Mateusz Pusz
2023-08-30 11:30:35 +02:00
parent 24803a96cc
commit f1c2c74ab0
19 changed files with 405 additions and 379 deletions
+3 -2
View File
@@ -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()