feat: alternative litre unit symbol L added to prevent ambiguities with 1

This commit is contained in:
Mateusz Pusz
2024-10-06 08:32:38 +02:00
parent 2249879d62
commit dd55a52675
2 changed files with 3 additions and 2 deletions

View File

@ -275,7 +275,7 @@ In most cases [scaled units are hidden behind named units](systems_of_units.md#s
However, there are a few real-life where a user directly faces a scaled unit. For example: However, there are a few real-life where a user directly faces a scaled unit. For example:
```cpp ```cpp
constexpr Unit auto l_per_100km = l / (mag<100> * km); constexpr Unit auto L_per_100km = L / (mag<100> * km);
``` ```
The above is a derived unit of litre divided by a scaled unit of 100 kilometers. As we can The above is a derived unit of litre divided by a scaled unit of 100 kilometers. As we can
@ -283,7 +283,7 @@ see a scaled unit has a magnitude and a reference unit. To denote the scope of s
a unit, we enclose it in `[...]`. For example, the following: a unit, we enclose it in `[...]`. For example, the following:
```cpp ```cpp
std::cout << 6.7 * l_per_100km << "\n"; std::cout << 6.7 * L_per_100km << "\n";
``` ```
prints: prints:

View File

@ -791,6 +791,7 @@ inline constexpr auto arcsec = arcsecond;
inline constexpr auto a = are; inline constexpr auto a = are;
inline constexpr auto ha = hectare; inline constexpr auto ha = hectare;
inline constexpr auto l = litre; inline constexpr auto l = litre;
inline constexpr auto L = litre; // both versions of litre are allowed
inline constexpr auto t = tonne; inline constexpr auto t = tonne;
inline constexpr auto Da = dalton; inline constexpr auto Da = dalton;
inline constexpr auto eV = electronvolt; inline constexpr auto eV = electronvolt;