forked from mpusz/mp-units
feat!: 💥 dimensionless quantities refactored
Dimensionless quantities are now represented by quantity types rather than by plain representation types. Only dimensionless quantities with `unitless` unit are implicitly convertible from representation types. `units::exp()` now is a function doing std::exp() on a representation type (previous `units::exp` class template was renamed to `units::exponent`). BREAKING_CHANGE: gcc-9.3 support removed BREAKING_CHANGE: `exp` and `Exp` renamed to `exponent` and `Exponent` Resolves #27 Resolves #42
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
#include <units/physical/si/resistance.h>
|
||||
#include <units/physical/si/time.h>
|
||||
#include <units/physical/si/voltage.h>
|
||||
#include <cmath>
|
||||
#include <units/math.h>
|
||||
#include <iostream>
|
||||
|
||||
int main()
|
||||
@@ -41,7 +41,7 @@ int main()
|
||||
constexpr auto R = 4.7q_kR;
|
||||
|
||||
for (auto t = 0q_ms; t <= 50q_ms; ++t) {
|
||||
const Voltage AUTO Vt = V0 * std::exp(-t / (R * C));
|
||||
const Voltage AUTO Vt = V0 * units::exp(-t / (R * C));
|
||||
|
||||
std::cout << "at " << t << " voltage is ";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user