Public Types | Static Public Attributes | List of all members
numeric::detail::shifting_constants< FloatingType > Struct Template Reference

Helper struct with common constants needed by the floating <--> decimal conversions. More...

#include <floating_conversion.hpp>

Public Types

using IntegerRep = std::conditional_t< is_double, uint64_t, uint32_t >
 Integer type that can hold the value of the significand.
 
using ShiftingRep = std::conditional_t< is_double, __uint128_t, uint64_t >
 Shift data back and forth in space of a type with 2x the starting bits, to give us enough room.
 

Static Public Attributes

static constexpr bool is_double = cuda::std::is_same_v<FloatingType, double>
 Whether the type is double.
 
static constexpr auto num_significand_bits = cuda::std::numeric_limits<FloatingType>::digits
 Num bits needed to hold the significand.
 
static constexpr int num_2s_shift_buffer_bits = is_double ? 4 : 1
 
static constexpr int max_digits_shift = is_double ? 18 : 9
 Max at-once decimal place shift.
 
static constexpr int max_bits_shift = max_digits_shift * 10 / 3
 Max at-once bit shift.
 
static constexpr auto max_digits_shift_pow
 10^max_digits_shift More...
 

Detailed Description

template<typename FloatingType>
struct numeric::detail::shifting_constants< FloatingType >

Helper struct with common constants needed by the floating <--> decimal conversions.

Definition at line 557 of file floating_conversion.hpp.

Member Data Documentation

◆ max_digits_shift_pow

template<typename FloatingType >
constexpr auto numeric::detail::shifting_constants< FloatingType >::max_digits_shift_pow
staticconstexpr
Initial value:
=
multiply_power10<IntegerRep>(IntegerRep(1), max_digits_shift)
std::conditional_t< is_double, uint64_t, uint32_t > IntegerRep
Integer type that can hold the value of the significand.
static constexpr int max_digits_shift
Max at-once decimal place shift.

10^max_digits_shift

Definition at line 618 of file floating_conversion.hpp.

◆ num_2s_shift_buffer_bits

template<typename FloatingType >
constexpr int numeric::detail::shifting_constants< FloatingType >::num_2s_shift_buffer_bits = is_double ? 4 : 1
staticconstexpr

buffer bits to account for shifting error

Definition at line 601 of file floating_conversion.hpp.


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