|
Console Library 4.7.0
A header-only library that makes C++ simple
|
提供运行时的分数运算。 More...
#include <cstdint>#include <cmath>#include <cstdlib>#include <iostream>#include <type_traits>#include "csexc.h"Go to the source code of this file.
Classes | |
| class | console::BasicRational< T > |
| 用于表示分数的基础模板类。 More... | |
Namespaces | |
| namespace | console |
| 本库所有组件所在的顶层命名空间。 | |
Typedefs | |
| using | console::Rational = BasicRational<intmax_t> |
| 以 intmax_t 为基的分数。 | |
| using | console::Rational_8 = BasicRational<int8_t> |
| 以 int8_t 为基的分数。 | |
| using | console::Rational_16 = BasicRational<int16_t> |
| 以 int16_t 为基的分数。 | |
| using | console::Rational_32 = BasicRational<int32_t> |
| 以 int32_t 为基的分数。 | |
| using | console::Rational_64 = BasicRational<int64_t> |
| 以 int64_t 为基的分数。 | |
提供运行时的分数运算。
包含模板类 BasicRational 和数个预设的别名。 几乎所有操作都有可能导致整数溢出,请使用较大的整数类型或自行检查。 为了数值计算的效率,BasicRational 内部不做检查。