tetl 0.1.0
Embedded Template Library
|
The typename template provides compile-time rational arithmetic support. Each instantiation of this template exactly represents any finite rational number as long as its numerator Num and denominator Denom are representable as compile-time constants of type intmax_t. More...
#include <ratio.hpp>
Public Types | |
using | type = ratio<num, den> |
Static Public Attributes | |
static constexpr intmax_t | den = abs(Denom) / gcd(Num, Denom) |
static constexpr intmax_t | num = detail::sign(Num) * detail::sign(Denom) * abs(Num) / gcd(Num, Denom) |
The typename template provides compile-time rational arithmetic support. Each instantiation of this template exactly represents any finite rational number as long as its numerator Num and denominator Denom are representable as compile-time constants of type intmax_t.