Stratax 0.3.1
Loading...
Searching...
No Matches
stratax::core::Promote< L, R > Struct Template Reference

Promotes two signed integer dtypes to the wider dtype. More...

#include <Promotion.hpp>

Public Types

using type
using type
using type
using type
using type
using type
using type

Detailed Description

template<typename L, typename R>
requires ( DTypeTraits<L>::kind == DTypeKind::SignedInteger && DTypeTraits<R>::kind == DTypeKind::SignedInteger )
struct stratax::core::Promote< L, R >

Promotes two signed integer dtypes to the wider dtype.

Promotes a real numeric dtype and a complex dtype.

Promotes two complex dtypes according to their real components.

Promotes two floating-point dtypes to the dtype with greater numerical precision.

Promotes an integer dtype and a floating-point dtype.

Promotes mixed signed and unsigned integer dtypes.

Promotes two unsigned integer dtypes to the wider dtype.

The smallest signed integer dtype capable of representing the complete ranges of both operands is selected. If no supported signed integer dtype is sufficiently wide, the result is float64.

The floating dtype is preserved when it has sufficient significand precision for the integer dtype. float32 is promoted to float64 when additional precision is required.

The real dtype is promoted against the real component of the complex dtype. The resulting real dtype is then mapped back to its corresponding complex dtype.

Definition at line 45 of file Promotion.hpp.

Member Typedef Documentation

◆ type [1/7]

template<typename L, typename R>
using stratax::core::Promote< L, R >::type
Initial value:
complex_from_real_t<promoted_component>

Definition at line 276 of file Promotion.hpp.

◆ type [2/7]

template<typename L, typename R>
using stratax::core::Promote< L, R >::type
Initial value:
complex_from_real_t<promoted_component>

Definition at line 228 of file Promotion.hpp.

◆ type [3/7]

template<typename L, typename R>
using stratax::core::Promote< L, R >::type
Initial value:
std::conditional_t<
L,
R
>
Provides compile-time metadata for a supported Stratax dtype.

Definition at line 200 of file Promotion.hpp.

◆ type [4/7]

template<typename L, typename R>
using stratax::core::Promote< L, R >::type
Initial value:
std::conditional_t<
(integer_digits <= floating_digits),
floating_type,
std::conditional_t<
std::same_as<floating_type, dtype::float32>,
dtype::float64,
floating_type
>
>

Definition at line 178 of file Promotion.hpp.

◆ type [5/7]

template<typename L, typename R>
using stratax::core::Promote< L, R >::type
Initial value:
std::conditional_t<
(required_bits <= 8),
dtype::int8,
std::conditional_t<
(required_bits <= 16),
dtype::int16,
std::conditional_t<
(required_bits <= 32),
dtype::int32,
std::conditional_t<
(required_bits <= 64),
dtype::int64,
dtype::float64
>
>
>
>

Definition at line 116 of file Promotion.hpp.

◆ type [6/7]

template<typename L, typename R>
using stratax::core::Promote< L, R >::type
Initial value:
std::conditional_t<
L,
R
>

Definition at line 64 of file Promotion.hpp.

◆ type [7/7]

template<typename L, typename R>
using stratax::core::Promote< L, R >::type
Initial value:
std::conditional_t<
L,
R
>

Definition at line 47 of file Promotion.hpp.


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