mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-06 13:44:27 +02:00
style: formatting and whitespaces fixed to make pre-commit happy
This commit is contained in:
@@ -60,21 +60,31 @@ void si_example()
|
||||
|
||||
std::cout << "\n*** SI units (c = " << c << " = " << c.in(si::metre / s) << ") ***\n";
|
||||
|
||||
std::cout << "\n[in `GeV` and `c`]\n" << "p = " << p1 << "\n" << "m = " << m1 << "\n" << "E = " << E << "\n";
|
||||
std::cout << "\n[in `GeV` and `c`]\n"
|
||||
<< "p = " << p1 << "\n"
|
||||
<< "m = " << m1 << "\n"
|
||||
<< "E = " << E << "\n";
|
||||
|
||||
const auto p2 = p1.in(GeV / (m / s));
|
||||
const auto m2 = m1.in(GeV / pow<2>(m / s));
|
||||
const auto E2 = total_energy(p2, m2, c).in(GeV);
|
||||
|
||||
std::cout << "\n[in `GeV`]\n" << "p = " << p2 << "\n" << "m = " << m2 << "\n" << "E = " << E2 << "\n";
|
||||
std::cout << "\n[in `GeV`]\n"
|
||||
<< "p = " << p2 << "\n"
|
||||
<< "m = " << m2 << "\n"
|
||||
<< "E = " << E2 << "\n";
|
||||
|
||||
const auto p3 = p1.in(kg * m / s);
|
||||
const auto m3 = m1.in(kg);
|
||||
const auto E3 = total_energy(p3, m3, c).in(J);
|
||||
|
||||
std::cout << "\n[in SI base units]\n" << "p = " << p3 << "\n" << "m = " << m3 << "\n" << "E = " << E3 << "\n";
|
||||
std::cout << "\n[in SI base units]\n"
|
||||
<< "p = " << p3 << "\n"
|
||||
<< "m = " << m3 << "\n"
|
||||
<< "E = " << E3 << "\n";
|
||||
|
||||
std::cout << "\n[converted from SI units back to GeV]\n" << "E = " << E3.force_in(GeV) << "\n";
|
||||
std::cout << "\n[converted from SI units back to GeV]\n"
|
||||
<< "E = " << E3.force_in(GeV) << "\n";
|
||||
}
|
||||
|
||||
void natural_example()
|
||||
|
Reference in New Issue
Block a user