|
Unit Conversion and Dimensional Analysis Library 3.6.1
A compile-time, header-only C++23 dimensional-analysis library
|
Defines a series of classes used to manipulate unit types, such as inverse<>, squared<>, and metric prefixes. More...
Topics | |
| Prefixes | |
| Defines the metric and binary prefix manipulators (e.g. | |
Typedefs | |
| template<ConversionFactorType Cf> | |
| using | units::inverse = typename detail::inverse_impl<Cf>::type |
| represents the inverse unit type of class U. | |
| template<ConversionFactorType Cf> | |
| using | units::squared = typename detail::squared_impl<Cf>::type |
| represents the unit type of class U squared | |
| template<ConversionFactorType Cf> | |
| using | units::cubed = typename detail::cubed_impl<Cf>::type |
| represents the type of class U cubed. | |
| template<ConversionFactorType Cf, std::intmax_t Eps = 10000000000> | |
| using | units::square_root = typename detail::sqrt_impl<Cf, Eps>::type |
| represents the square root of type class U. | |
Defines a series of classes used to manipulate unit types, such as inverse<>, squared<>, and metric prefixes.
Unit manipulators can be chained together, e.g. inverse<squared<pico<time::seconds>>> to represent picoseconds^-2.
| using units::cubed = typename detail::cubed_impl<Cf>::type |
| using units::inverse = typename detail::inverse_impl<Cf>::type |
| using units::square_root = typename detail::sqrt_impl<Cf, Eps>::type |
represents the square root of type class U.
Calculates a rational approximation of the square root of the unit. The error in the calculation is bounded by 1/epsilon (Eps). E.g. for the default value of 10000000000, the maximum error will be a/10000000000, or 1e-8, or said another way, the error will be on the order of 10^-9. Since these calculations are done at compile time, it is advisable to set epsilon to the highest value that does not cause an integer overflow in the calculation. If you can't compile ratio_sqrt due to overflow errors, reducing the value of epsilon sufficiently will correct the problem.
ratio_sqrt is guaranteed to converge for all values of Ratio which do not overflow.
| Cf | unit type to take the square root of. |
| Eps | Value of epsilon, which represents the inverse of the maximum allowable error. This value should be chosen to be as high as possible before integer overflow errors occur in the compiler. |
| using units::squared = typename detail::squared_impl<Cf>::type |
represents the unit type of class U squared
| Cf | unit type to square. |
E.g. square<meters> will represent meters^2.