ldexp

Description

Construct float from mantissa and exponent.

Signature

T ldexp<T>(
    T x,
    T exp)
    where T : __BuiltinFloatingPointType;

vector<T, N> ldexp<T, int N>(
    vector<T, N> x,
    vector<T, N> exp)
    where T : __BuiltinFloatingPointType;

matrix<T, N, M> ldexp<T, int N, int M>(
    matrix<T, N, M> x,
    matrix<T, N, M> exp)
    where T : __BuiltinFloatingPointType;

T ldexp<T, E>(
    T x,
    E exp)
    where T : __BuiltinFloatingPointType
    where E : __BuiltinIntegerType;

vector<T, N> ldexp<T, E, int N>(
    vector<T, N> x,
    vector<E, N> exp)
    where T : __BuiltinFloatingPointType
    where E : __BuiltinIntegerType;

Generic Parameters

T: __BuiltinFloatingPointType

N : int

M : int

E: __BuiltinIntegerType

Parameters

x : T

The significand.

exp : T

The exponent.

x : vector<T, N>

The significand.

exp : vector<T, N>

The exponent.

x : matrix<T, N, M>

The significand.

exp : matrix<T, N, M>

The exponent.

exp : E

The exponent.

exp : vector<E, N>

The exponent.

Return value

The floating-point number constructed from x and exp.

Availability and Requirements

Defined for the following targets:

hlsl

Available in all stages.

glsl

Available in all stages.

cpp

Available in all stages.

cuda

Available in all stages.

metal

Available in all stages.

wgsl

Available in all stages.

spirv

Available in all stages.

llvm

Available in all stages.