mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-04 04:44:27 +02:00
refactor: 💥 𝜋 replaced with π
This commit is contained in:
@@ -45,7 +45,7 @@ inline constexpr struct speed_of_light_in_vacuum final :
|
||||
} // namespace si2019
|
||||
|
||||
inline constexpr struct magnetic_constant final :
|
||||
named_unit<{u8"μ₀", "u_0"}, mag<4> * mag<𝜋> * mag_power<10, -7> * henry / metre> {} magnetic_constant;
|
||||
named_unit<{u8"μ₀", "u_0"}, mag<4> * mag<π> * mag_power<10, -7> * henry / metre> {} magnetic_constant;
|
||||
|
||||
} // namespace mp_units::si
|
||||
```
|
||||
|
@@ -196,12 +196,12 @@ For some units, a magnitude might also be irrational. The best example here is a
|
||||
is defined using a floating-point magnitude having a factor of the number π (Pi):
|
||||
|
||||
```cpp
|
||||
inline constexpr struct pi final : mag_constant<symbol_text{u8"𝜋", "pi"}, std::numbers::pi_v<long double>> {} pi;
|
||||
inline constexpr auto 𝜋 = pi;
|
||||
inline constexpr struct pi final : mag_constant<symbol_text{u8"\u03c0", "pi"}, std::numbers::pi_v<long double>> {} pi;
|
||||
inline constexpr auto π = pi;
|
||||
```
|
||||
|
||||
```cpp
|
||||
inline constexpr struct degree final : named_unit<{u8"°", "deg"}, mag<𝜋> / mag<180> * si::radian> {} degree;
|
||||
inline constexpr struct degree final : named_unit<{u8"°", "deg"}, mag<π> / mag<180> * si::radian> {} degree;
|
||||
```
|
||||
|
||||
|
||||
|
@@ -314,7 +314,7 @@ prints:
|
||||
40771 EQUIV{[1/25146 mi], [1/15625 km]}
|
||||
108167 EQUIV{[1/50292 mi], [1/57875 nmi]}
|
||||
23 EQUIV{[1/5 km/h], [1/18 m/s]}
|
||||
183.142 EQUIV{[1/𝜋°], [1/180 rad]}
|
||||
183.142 EQUIV{[1/π°], [1/180 rad]}
|
||||
```
|
||||
|
||||
Thanks to the above, it might be easier for the user to reason about the magnitude of the resulting
|
||||
|
Reference in New Issue
Block a user