文件 | |
文件 | fixed_point.hpp |
定点数据类型的类定义。 | |
文件 | fixed_point.hpp |
定点数据类型的类定义。 | |
类 | |
结构体 | numeric::scaled_integer< Rep, > |
用于构造 fixed_point 当值已被移位时使用的辅助结构体。 更多... | |
类 | numeric::fixed_point< Rep, Rad > |
表示具有固定精度量的数字的类型。 更多... | |
类型定义 | |
使用 | numeric::decimal32 = fixed_point< int32_t, Radix::BASE_10 > |
32位十进制定点 | |
使用 | numeric::decimal64 = fixed_point< int64_t, Radix::BASE_10 > |
64位十进制定点 | |
使用 | numeric::decimal128 = fixed_point< __int128_t, Radix::BASE_10 > |
128位十进制定点 | |
枚举 | |
枚举 | numeric::scale_type : int32_t |
fixed_point 的刻度类型。 | |
枚举类 | numeric::Radix : int32_t { BASE_2 = 2 , BASE_10 = 10 } |
用于构造 fixed_point 的范围枚举器 更多... | |
函数 | |
template<typename T > | |
constexpr CUDF_HOST_DEVICE auto | numeric::is_supported_representation_type () |
如果表示类型受 fixed_point 支持,则返回 true 更多... | |
template<typename Rep , typename T > | |
CUDF_HOST_DEVICE auto | numeric::addition_overflow (T lhs, T rhs) |
用于识别加法时整数溢出的函数。 更多... | |
template<typename Rep , typename T > | |
CUDF_HOST_DEVICE auto | numeric::subtraction_overflow (T lhs, T rhs) |
用于识别减法时整数溢出的函数。 更多... | |
template<typename Rep , typename T > | |
CUDF_HOST_DEVICE auto | numeric::division_overflow (T lhs, T rhs) |
用于识别除法时整数溢出的函数。 更多... | |
template<typename Rep , typename T > | |
CUDF_HOST_DEVICE auto | numeric::multiplication_overflow (T lhs, T rhs) |
用于识别乘法时整数溢出的函数。 更多... | |
template<typename Rep1 , Radix Rad1> | |
CUDF_HOST_DEVICE fixed_point< Rep1, Rad1 > | numeric::operator+ (fixed_point< Rep1, Rad1 > const &lhs, fixed_point< Rep1, Rad1 > const &rhs) |
template<typename Rep1 , Radix Rad1> | |
CUDF_HOST_DEVICE fixed_point< Rep1, Rad1 > | numeric::operator- (fixed_point< Rep1, Rad1 > const &lhs, fixed_point< Rep1, Rad1 > const &rhs) |
template<typename Rep1 , Radix Rad1> | |
CUDF_HOST_DEVICE fixed_point< Rep1, Rad1 > | numeric::operator* (fixed_point< Rep1, Rad1 > const &lhs, fixed_point< Rep1, Rad1 > const &rhs) |
template<typename Rep1 , Radix Rad1> | |
CUDF_HOST_DEVICE fixed_point< Rep1, Rad1 > | numeric::operator/ (fixed_point< Rep1, Rad1 > const &lhs, fixed_point< Rep1, Rad1 > const &rhs) |
template<typename Rep1 , Radix Rad1> | |
CUDF_HOST_DEVICE bool | numeric::operator== (fixed_point< Rep1, Rad1 > const &lhs, fixed_point< Rep1, Rad1 > const &rhs) |
template<typename Rep1 , Radix Rad1> | |
CUDF_HOST_DEVICE bool | numeric::operator!= (fixed_point< Rep1, Rad1 > const &lhs, fixed_point< Rep1, Rad1 > const &rhs) |
template<typename Rep1 , Radix Rad1> | |
CUDF_HOST_DEVICE bool | numeric::operator<= (fixed_point< Rep1, Rad1 > const &lhs, fixed_point< Rep1, Rad1 > const &rhs) |
template<typename Rep1 , Radix Rad1> | |
CUDF_HOST_DEVICE bool | numeric::operator>= (fixed_point< Rep1, Rad1 > const &lhs, fixed_point< Rep1, Rad1 > const &rhs) |
template<typename Rep1 , Radix Rad1> | |
CUDF_HOST_DEVICE bool | numeric::operator< (fixed_point< Rep1, Rad1 > const &lhs, fixed_point< Rep1, Rad1 > const &rhs) |
template<typename Rep1 , Radix Rad1> | |
CUDF_HOST_DEVICE bool | numeric::operator> (fixed_point< Rep1, Rad1 > const &lhs, fixed_point< Rep1, Rad1 > const &rhs) |
template<typename Rep1 , Radix Rad1> | |
CUDF_HOST_DEVICE fixed_point< Rep1, Rad1 > | numeric::operator% (fixed_point< Rep1, Rad1 > const &lhs, fixed_point< Rep1, Rad1 > const &rhs) |
|
强类型 |
用于构造 fixed_point
的范围枚举器
示例
定义于文件 fixed_point.hpp 的 54 行。
|
inline |
用于识别加法时整数溢出的函数。
Rep | 要检查溢出的整数类型 |
T | lhs 和 rhs 的类型(确保它们是相同的类型) |
lhs | 加法的左操作数 |
rhs | 加法的右操作数 |
定义于文件 fixed_point.hpp 的 632 行。
|
inline |
用于识别除法时整数溢出的函数。
Rep | 要检查溢出的整数类型 |
T | lhs 和 rhs 的类型(确保它们是相同的类型) |
lhs | 除法的左操作数 |
rhs | 除法的右操作数 |
定义于文件 fixed_point.hpp 的 662 行。
|
inlineconstexpr |
如果表示类型受 fixed_point
支持,则返回 true
T | 表示类型 |
fixed_point
实现支持,则为 true
定义于文件 fixed_point.hpp 的 63 行。
|
inline |
用于识别乘法时整数溢出的函数。
Rep | 要检查溢出的整数类型 |
T | lhs 和 rhs 的类型(确保它们是相同的类型) |
lhs | 乘法的左操作数 |
rhs | 乘法的右操作数 |
定义于文件 fixed_point.hpp 的 676 行。
|
inline |
如果 _scale
相等,则比较 _value
。如果 _scale
不相等,则将具有较大 _scale
的数字移位到较小的 _scale
,然后比较 _value
。
Rep1 | 操作数 lhs 和 rhs 的表示类型 |
Rad1 | 操作数 lhs 和 rhs 的基数类型 |
lhs | 左操作数 |
rhs | 右操作数 |
lhs
和 rhs
不相等则为 true,否则为 false定义于文件 fixed_point.hpp 的 762 行。
|
inline |
如果 _scale
相等,直接计算模数。如果 _scale
不相等,则将具有较大 _scale
的数字移位到较小的 _scale
,然后计算模数。
Rep1 | 操作数 lhs 和 rhs 的表示类型 |
Rad1 | 操作数 lhs 和 rhs 的基数类型 |
lhs | 左操作数 |
rhs | 右操作数 |
fixed_point
数字定义于文件 fixed_point.hpp 的 807 行。
|
inline |
将 _scale
相加,并将 _value
相乘。
Rep1 | 操作数 lhs 和 rhs 的表示类型 |
Rad1 | 操作数 lhs 和 rhs 的基数类型 |
lhs | 左操作数 |
rhs | 右操作数 |
fixed_point
乘积定义于文件 fixed_point.hpp 的 723 行。
|
inline |
如果 _scale
相等,则将 _value
相加。如果 _scale
不相等,则将具有较大 _scale
的数字移位到较小的 _scale
,然后将 _value
相加。
Rep1 | 操作数 lhs 和 rhs 的表示类型 |
Rad1 | 操作数 lhs 和 rhs 的基数类型 |
lhs | 左操作数 |
rhs | 右操作数 |
fixed_point
和定义于文件 fixed_point.hpp 的 687 行。
|
inline |
如果 _scale
相等,则将 _value
相减。如果 _scale
不相等,则将具有较大 _scale
的数字移位到较小的 _scale
,然后将 _value
相减。
Rep1 | 操作数 lhs 和 rhs 的表示类型 |
Rad1 | 操作数 lhs 和 rhs 的基数类型 |
lhs | 左操作数 |
rhs | 右操作数 |
fixed_point
差定义于文件 fixed_point.hpp 的 705 行。
|
inline |
将 _scale
相减,并将 _value
相除。
Rep1 | 操作数 lhs 和 rhs 的表示类型 |
Rad1 | 操作数 lhs 和 rhs 的基数类型 |
lhs | 左操作数 |
rhs | 右操作数 |
fixed_point
商定义于文件 fixed_point.hpp 的 738 行。
|
inline |
如果 _scale
相等,则比较 _value
。如果 _scale
不相等,则将具有较大 _scale
的数字移位到较小的 _scale
,然后比较 _value
。
Rep1 | 操作数 lhs 和 rhs 的表示类型 |
Rad1 | 操作数 lhs 和 rhs 的基数类型 |
lhs | 左操作数 |
rhs | 右操作数 |
lhs
小于 rhs
则为 true,否则为 false定义于文件 fixed_point.hpp 的 789 行。
|
inline |
如果 _scale
相等,则比较 _value
。如果 _scale
不相等,则将具有较大 _scale
的数字移位到较小的 _scale
,然后比较 _value
。
Rep1 | 操作数 lhs 和 rhs 的表示类型 |
Rad1 | 操作数 lhs 和 rhs 的基数类型 |
lhs | 左操作数 |
rhs | 右操作数 |
lhs
小于或等于 rhs
则为 true,否则为 false定义于文件 fixed_point.hpp 的 771 行。
|
inline |
如果 _scale
相等,则比较 _value
。如果 _scale
不相等,则将具有较大 _scale
的数字移位到较小的 _scale
,然后比较 _value
。
Rep1 | 操作数 lhs 和 rhs 的表示类型 |
Rad1 | 操作数 lhs 和 rhs 的基数类型 |
lhs | 左操作数 |
rhs | 右操作数 |
lhs
和 rhs
相等则为 true,否则为 false定义于文件 fixed_point.hpp 的 753 行。
|
inline |
如果 _scale
相等,则比较 _value
。如果 _scale
不相等,则将具有较大 _scale
的数字移位到较小的 _scale
,然后比较 _value
。
Rep1 | 操作数 lhs 和 rhs 的表示类型 |
Rad1 | 操作数 lhs 和 rhs 的基数类型 |
lhs | 左操作数 |
rhs | 右操作数 |
lhs
大于 rhs
则为 true,否则为 false定义于文件 fixed_point.hpp 的 798 行。
|
inline |
如果 _scale
相等,则比较 _value
。如果 _scale
不相等,则将具有较大 _scale
的数字移位到较小的 _scale
,然后比较 _value
。
Rep1 | 操作数 lhs 和 rhs 的表示类型 |
Rad1 | 操作数 lhs 和 rhs 的基数类型 |
lhs | 左操作数 |
rhs | 右操作数 |
lhs
大于或等于 rhs
则为 true,否则为 false定义于文件 fixed_point.hpp 的 780 行。
|
inline |
用于识别减法时整数溢出的函数。
Rep | 要检查溢出的整数类型 |
T | lhs 和 rhs 的类型(确保它们是相同的类型) |
lhs | 减法的左操作数 |
rhs | 减法的右操作数 |
定义于文件 fixed_point.hpp 的 647 行。