Classes | Typedefs | Enumerations | Functions
numeric Namespace Reference

fixed_point and supporting types More...

Classes

struct  scaled_integer
 Helper struct for constructing fixed_point when value is already shifted. More...
 
class  fixed_point
 A type for representing a number with a fixed amount of precision. More...
 

Typedefs

using decimal32 = fixed_point< int32_t, Radix::BASE_10 >
 32-bit decimal fixed point
 
using decimal64 = fixed_point< int64_t, Radix::BASE_10 >
 64-bit decimal fixed point
 
using decimal128 = fixed_point< __int128_t, Radix::BASE_10 >
 128-bit decimal fixed point
 

Enumerations

enum  scale_type : int32_t
 The scale type for fixed_point.
 
enum class  Radix : int32_t { BASE_2 = 2 , BASE_10 = 10 }
 Scoped enumerator to use when constructing fixed_point More...
 

Functions

template<typename T >
constexpr auto is_supported_representation_type ()
 Returns true if the representation type is supported by fixed_point More...
 
template<typename Rep , typename T >
CUDF_HOST_DEVICE auto addition_overflow (T lhs, T rhs)
 Function for identifying integer overflow when adding. More...
 
template<typename Rep , typename T >
CUDF_HOST_DEVICE auto subtraction_overflow (T lhs, T rhs)
 Function for identifying integer overflow when subtracting. More...
 
template<typename Rep , typename T >
CUDF_HOST_DEVICE auto division_overflow (T lhs, T rhs)
 Function for identifying integer overflow when dividing. More...
 
template<typename Rep , typename T >
CUDF_HOST_DEVICE auto multiplication_overflow (T lhs, T rhs)
 Function for identifying integer overflow when multiplying. More...
 
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)
 

Detailed Description

fixed_point and supporting types