|
MSTL 1.4.0
A Modern C++ Library with extended functionality, web components, and utility libraries
|
比率类模板 更多...
#include <ratio.hpp>
Public 类型 | |
| using | type = ratio<num, den> |
| 自身的类型 | |
静态 Public 属性 | |
| static constexpr intmax_t | num |
| 分母不能为0 | |
| static constexpr intmax_t | den |
| 约分后的分母 | |
比率类模板
| Numerator | 分子 |
| Denominator | 分母,默认为1 |
表示编译期比率,自动进行约分,确保分子分母是最简形式。 分母总是正的,符号由分子表示。