numeric.float.internal

Parameter \ Type | float32 | float64 | +===================+===========+===========+ | MantissaWidth | 23 | 52 | +——————-+———–+———–+ | ExponentWidth | 8 | 11 | +——————-+———–+———–+ | Bias | 127 | 1023 | +——————-+———–+———–+


using float64 = uint64 §
enum NativeFloatSupport : uint1 §

Values

enum Denorm : uint1 §

Denormalization flag.

Values

template <auto MantissaWidth, auto ExponentWidth>
struct floatPackedFormat §

Fields

  • uint<MantissaWidth> mantissa §
    
  • uint<ExponentWidth> exponent §
    
  • uint1 sign §
    
struct specialCaseFlags §

Fields

  • bool nan §
    
  • bool zero §
    
  • bool inf §
    
  • bool finite §
    
template <auto MantissaWidth, auto ExponentWidth, Denorm denorm_mode>
inline 
specialCaseFlags
getSpecialCases_internal(floatPackedFormat<MantissaWidth, ExponentWidth> a) §

Check if nan, zero, inf, or finite.

template <
    typename From,
    typename To,
    auto MantissaWidth,
    auto ExponentWidth,
    auto Bias
    >
inline To int_to_float(From input) §

Convert an integer value to a floating-point value. This generic function handles conversion both to float32 and to float64.

This function is not meant to be called by the general public. It is a worker function called by the from_int functions in the float32 and float64 modules. Those functions are responsible for passing the proper template parameters.

Parameters

  • typename From
    

    Type of the integer to convert.

  • typename To
    

    Type to be converted to. This must be either float32 or float64.

  • auto MantissaWidth
    
  • auto ExponentWidth
    
  • auto Bias
    
template <
    typename From,
    typename To,
    auto MantissaWidth,
    auto ExponentWidth,
    auto Bias
    >
inline optional<To> float_to_int(From input) §

Convert a floating-point value to an integer value. This generic function handles conversion both from float32 and from float64.

This function is not meant to be called by the general public. It is a worker function called by the to_int functions in the float32 and float64 modules. Those functions are responsible for passing the proper template parameters.

Parameters

  • typename From
    

    Type of the float to convert. This must be either float32 or float64.

  • typename To
    

    Integer type to be converted to. This may be signed or unsigned.

  • auto MantissaWidth
    
  • auto ExponentWidth
    
  • auto Bias
    
template <typename T>
inline pair<T, T> get_limits() §
template <
    typename Type,
    auto MantissaWidth,
    auto ExponentWidth,
    auto Bias,
    Denorm DenormMode
    >
inline Type ceil_internal(Type x) §

Return the smallest integer not less than x.

template <
    typename Type,
    auto MantissaWidth,
    auto ExponentWidth,
    auto Bias,
    Denorm DenormMode
    >
inline Type floor_internal(Type x) §

Return the largest integer not greater than x.

template <
    typename Type,
    auto MantissaWidth,
    auto ExponentWidth,
    auto Bias,
    Denorm DenormMode
    >
inline Type round_internal(Type x) §

Return the nearest integer to x, rounding halfway away from zero.

template <
    typename Type,
    auto MantissaWidth,
    auto ExponentWidth,
    auto Bias,
    Denorm DenormMode
    >
inline Type trunc_internal(Type x) §

Return the nearest integer not greater in magnitude than x.