libcudf  24.04.00
Public Member Functions | Public Attributes | List of all members
numeric::scaled_integer< Rep, > Struct Template Reference

Helper struct for constructing fixed_point when value is already shifted. More...

#include <fixed_point.hpp>

Public Member Functions

CUDF_HOST_DEVICE scaled_integer (Rep v, scale_type s)
 Constructor for scaled_integer More...
 

Public Attributes

Rep value
 The value of the fixed point number.
 
scale_type scale
 The scale of the value.
 

Detailed Description

template<typename Rep, typename cuda::std::enable_if_t< is_supported_representation_type< Rep >()> * = nullptr>
struct numeric::scaled_integer< Rep, >

Helper struct for constructing fixed_point when value is already shifted.

Example:

using decimal32 = fixed_point<int32_t, Radix::BASE_10>;
auto n = decimal32{scaled_integer{1001, 3}}; // n = 1.001
fixed_point< int32_t, Radix::BASE_10 > decimal32
32-bit decimal fixed point
CUDF_HOST_DEVICE scaled_integer(Rep v, scale_type s)
Constructor for scaled_integer
Template Parameters
RepThe representation type (either int32_t or int64_t)

Definition at line 198 of file fixed_point.hpp.

Constructor & Destructor Documentation

◆ scaled_integer()

template<typename Rep , typename cuda::std::enable_if_t< is_supported_representation_type< Rep >()> * = nullptr>
CUDF_HOST_DEVICE numeric::scaled_integer< Rep, >::scaled_integer ( Rep  v,
scale_type  s 
)
inlineexplicit

Constructor for scaled_integer

Parameters
vThe value of the fixed point number
sThe scale of the value

Definition at line 207 of file fixed_point.hpp.


The documentation for this struct was generated from the following file: