refactor: quantity::count() renamed to quantity::number()

Resolves #259
This commit is contained in:
Mateusz Pusz
2021-03-19 06:47:37 +01:00
parent bcaf252dec
commit 901b09fd52
26 changed files with 283 additions and 282 deletions
+2 -2
View File
@@ -179,7 +179,7 @@ code will not compile::
To make it compile fine we have to either explicitly get the value stored in the quantity::
auto v = std::exp(quantity_cast<one>(10_q_m / 5_q_m).count());
auto v = std::exp(quantity_cast<one>(10_q_m / 5_q_m).number());
or use a mathematical wrapper function from `units` namespace::
@@ -188,4 +188,4 @@ or use a mathematical wrapper function from `units` namespace::
.. important::
Always remember to explicitly cast the quantity to the destination unit with `quantity_cast` before
calling `quantity::count()`!
calling `quantity::number()`!
+1 -1
View File
@@ -336,7 +336,7 @@ will print ``50 %`` to the console output.
Again, according to the ISO definition "such quantities convey more information than a
number". This is exactly what we observe in the above example. The value stored inside
the quantity, the text output, and the value returned by the `quantity::count()` member
the quantity, the text output, and the value returned by the `quantity::number()` member
function is ``50`` rather than ``0.5``. It means that dimensionless quantities behave
like all other quantities and store the value in terms of a ratio of a coherent unit.
This allows us to not loose precision when we divide quantities of the same dimensions