|
stator
A math, geometry, and utility library
|
Physical constants approximated in std::ratio representation. More...
#include <constants.hpp>
Public Types | |
| typedef std::ratio< 28245729, 10391023 > | e |
A rational approximation of . More... | |
| typedef std::ratio< 47627751, 15160384 > | pi |
A rational approximation of . More... | |
Selecting an appropriate approximation depends on a number of factors. C++11 requires implementations to support at least the long long type (64bits). As std::ratio always uses the maximum size integer to represent its numerator/denominator, std::ratio must support
for the numerator and/or denominator. However, when calculations are performed using std::ratio, sufficient range must be retained for the calculation.
Because of these reasons, we choose rational approximations close to the limits of double precision, or slightly less accurate approximations where increased precision would require a dramatic increase in the magnitude of the numerator/denominator terms.
Definition at line 85 of file constants.hpp.
| typedef std::ratio<28245729, 10391023> stator::constant_ratio::e |
| typedef std::ratio<47627751, 15160384> stator::constant_ratio::pi |
1.8.13