|
| template<typename ratio1, typename ratio2> |
| using | ratio_multiply = typename inner::__ratio_multiply_impl<ratio1, ratio2>::type |
| | 比率乘法类型别名
|
| template<typename ratio1, typename ratio2> |
| using | ratio_divide = typename inner::__ratio_divide_impl<ratio1, ratio2>::type |
| | 比率除法类型别名
|
| template<typename ratio1, typename ratio2> |
| using | ratio_add = typename inner::ratio_add<ratio1, ratio2>::type |
| | 比率加法类型别名
|
| template<typename ratio1, typename ratio2> |
| using | ratio_subtract = typename inner::ratio_subtract<ratio1, ratio2>::type |
| | 比率减法类型别名
|
|
using | atto = ratio<1, 1000000000000000000> |
| | 阿托(10^-18)
|
|
using | femto = ratio<1, 1000000000000000> |
| | 飞(10^-15)
|
|
using | pico = ratio<1, 1000000000000> |
| | 皮(10^-12)
|
|
using | nano = ratio<1, 1000000000> |
| | 纳(10^-9)
|
|
using | micro = ratio<1, 1000000> |
| | 微(10^-6)
|
|
using | milli = ratio<1, 1000> |
| | 毫(10^-3)
|
|
using | centi = ratio<1, 100> |
| | 厘(10^-2)
|
|
using | deci = ratio<1, 10> |
| | 分(10^-1)
|
|
using | deca = ratio<10, 1> |
| | 十(10^1)
|
|
using | hecto = ratio<100, 1> |
| | 百(10^2)
|
|
using | kilo = ratio<1000, 1> |
| | 千(10^3)
|
|
using | mega = ratio<1000000, 1> |
| | 兆(10^6)
|
|
using | giga = ratio<1000000000, 1> |
| | 吉(10^9)
|
|
using | tera = ratio<1000000000000, 1> |
| | 太(10^12)
|
|
using | peta = ratio<1000000000000000, 1> |
| | 拍(10^15)
|
|
using | exa = ratio<1000000000000000000, 1> |
| | 艾(10^18)
|
|
|
template<typename T> |
| NEFORCE_INLINE17 constexpr bool | is_ratio_v = is_ratio<T>::value |
| | is_ratio的便捷变量模板
|
|
template<typename ratio1, typename ratio2> |
| NEFORCE_INLINE17 constexpr bool | ratio_equal_v = ratio_equal<ratio1, ratio2>::value |
| | ratio_equal的便捷变量模板
|
|
template<typename ratio1, typename ratio2> |
| NEFORCE_INLINE17 constexpr bool | ratio_not_equal_v = ratio_not_equal<ratio1, ratio2>::value |
| | ratio_not_equal的便捷变量模板
|
|
template<typename ratio1, typename ratio2> |
| NEFORCE_INLINE17 constexpr bool | ratio_less_v = ratio_less<ratio1, ratio2>::value |
| | ratio_less的便捷变量模板
|
|
template<typename ratio1, typename ratio2> |
| NEFORCE_INLINE17 constexpr bool | ratio_less_equal_v = ratio_less_equal<ratio1, ratio2>::value |
| | ratio_less_equal的便捷变量模板
|
|
template<typename ratio1, typename ratio2> |
| NEFORCE_INLINE17 constexpr bool | ratio_greater_v = ratio_greater<ratio1, ratio2>::value |
| | ratio_greater的便捷变量模板
|
|
template<typename ratio1, typename ratio2> |
| NEFORCE_INLINE17 constexpr bool | ratio_greater_equal_v = ratio_greater_equal<ratio1, ratio2>::value |
| | ratio_greater_equal的便捷变量模板
|
比率计算
此文件提供了编译期比率的实现, 支持比率的各种运算,包括加减乘除、比较、化简等操作。
在文件 ratio.hpp 中定义.