| 类型定义 | 枚举 | 函数
numeric 命名空间参考

fixed_point 及支持类型 更多...

struct  scaled_integer
 用于构造 fixed_point 的辅助结构体,当值已被移位时。 更多...
 
class  fixed_point
 表示具有固定精度量的数字的类型。 更多...
 

类型定义

using decimal32 = fixed_point< int32_t, Radix::BASE_10 >
 32位十进制定点数
 
using decimal64 = fixed_point< int64_t, Radix::BASE_10 >
 64位十进制定点数
 
using decimal128 = fixed_point< __int128_t, Radix::BASE_10 >
 128位十进制定点数
 

枚举

enum  scale_type : int32_t
 fixed_point 的比例类型。
 
enum class  Radix : int32_t { BASE_2 = 2 , BASE_10 = 10 }
 构造 fixed_point 时使用的作用域枚举器 更多...
 

函数

template<typename T >
constexpr CUDF_HOST_DEVICE auto is_supported_representation_type ()
 如果表示类型被 fixed_point 支持,则返回 true 更多...
 
template<typename Rep , typename T >
CUDF_HOST_DEVICE auto addition_overflow (T lhs, T rhs)
 用于识别加法时整数溢出的函数。 更多...
 
template<typename Rep , typename T >
CUDF_HOST_DEVICE auto subtraction_overflow (T lhs, T rhs)
 用于识别减法时整数溢出的函数。 更多...
 
template<typename Rep , typename T >
CUDF_HOST_DEVICE auto division_overflow (T lhs, T rhs)
 用于识别除法时整数溢出的函数。 更多...
 
template<typename Rep , typename T >
CUDF_HOST_DEVICE auto multiplication_overflow (T lhs, T rhs)
 用于识别乘法时整数溢出的函数。 更多...
 
template<typename Rep1 , Radix Rad1>
CUDF_HOST_DEVICE fixed_point< Rep1, Rad1 > 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 > 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 > 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 > operator/ (fixed_point< Rep1, Rad1 > const &lhs, fixed_point< Rep1, Rad1 > const &rhs)
 
template<typename Rep1 , Radix Rad1>
CUDF_HOST_DEVICE bool operator== (fixed_point< Rep1, Rad1 > const &lhs, fixed_point< Rep1, Rad1 > const &rhs)
 
template<typename Rep1 , Radix Rad1>
CUDF_HOST_DEVICE bool operator!= (fixed_point< Rep1, Rad1 > const &lhs, fixed_point< Rep1, Rad1 > const &rhs)
 
template<typename Rep1 , Radix Rad1>
CUDF_HOST_DEVICE bool operator<= (fixed_point< Rep1, Rad1 > const &lhs, fixed_point< Rep1, Rad1 > const &rhs)
 
template<typename Rep1 , Radix Rad1>
CUDF_HOST_DEVICE bool operator>= (fixed_point< Rep1, Rad1 > const &lhs, fixed_point< Rep1, Rad1 > const &rhs)
 
template<typename Rep1 , Radix Rad1>
CUDF_HOST_DEVICE bool operator< (fixed_point< Rep1, Rad1 > const &lhs, fixed_point< Rep1, Rad1 > const &rhs)
 
template<typename Rep1 , Radix Rad1>
CUDF_HOST_DEVICE bool 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 > operator% (fixed_point< Rep1, Rad1 > const &lhs, fixed_point< Rep1, Rad1 > const &rhs)
 

详细描述

fixed_point 及支持类型