numeric.float32


inline bool isnan(float32 x) §source

Check x is not a number.

inline bool isinf(float32 x) §source

Check x is positive or negative infinity.

inline bool isfinite(float32 x) §source
inline bool isnormal(float32 x) §source
inline bool signbit(float32 x) §source

Return sign of x.

template <Denorm denorm_mode>
inline float32 add(float32 in1, float32 in2) §source

Addition.

template <Denorm denorm_mode>
inline float32 mul(float32 in1, float32 in2) §source

Multiplication.

template <Denorm denorm_mode>
inline bool eq(float32 in1, float32 in2) §source

Compare two float32 values for equality.

template <Denorm denorm_mode>
inline bool lt(float32 in1, float32 in2) §source

Check in1 less than in2.

template <Denorm denorm_mode>
inline bool gt(float32 in1, float32 in2) §source

Check in1 greater than in2.

template <Denorm denorm_mode>
inline float32 sub(float32 in1, float32 in2) §source

Subtract in2 from in1.

inline float32 rcp(float32 x) §source

Reciprocal 1 / x.

inline float32 exp2(float32 x) §source

2x

inline float32 exp(float32 x) §source

ex

inline float32 expm1(float32 x) §source

Calculate ex − 1. Denorm inputs and outputs are supported. For smaller values of x, expm1(x) may be more accurate than exp(x)-1.

inline float32 log2(float32 x) §source

log2(x)

inline float32 log(float32 x) §source

ln(x)

inline float32 log10(float32 x) §source

log10(x)

inline float32 log1p(float32 value) §source

Calculate ln(x + 1). Denorm inputs and outputs are supported. For small values of x, log1p may be more accurate than log(1+x).

inline float32 logb(float32 x) §source

Calculate the floating-point value of the unbiased exponent part of log(x). If x is a subnormal value, the result of log2(mantissa part of x)-126 is returned.

inline int32 ilogb(float32 x) §source

Return the signed integral value of the unbiased exponent part of log(x). If x is a subnormal value, the result of log2(mantissa part of x)-126 is returned.

inline float32 atan(float32 x) §source

Return the principal values of arctangent. Denorm inputs and outputs are supported.

inline float32 pow(float32 base, float32 expo) §source

baseexpo

inline float32 sin(float32 x) §source

sin(x) with x in radians.

inline float32 cos(float32 x) §source

cos(x) with x in radians.

template <Denorm denorm_mode>
inline float32 min(float32 x, float32 y) §source

Return the smaller of x and y. A NaN is treated as missing data, and the other value will be returned.

template <Denorm denorm_mode>
inline float32 max(float32 x, float32 y) §source

Return the larger of x and y. A NaN is treated as missing data, and the other value will be returned.

template <Denorm denorm_mode>
inline float32 ceil(float32 x) §source

Return the smallest integer not less than x: x

template <Denorm denorm_mode>
inline float32 floor(float32 x) §source

Return the largest integer not greater than x: x

template <Denorm denorm_mode>
inline float32 round(float32 x) §source

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

template <Denorm denorm_mode>
inline float32 trunc(float32 x) §source

Return the nearest integer not greater in magnitude than x.

template <Denorm denorm_mode>
inline float32 dim(float32 x, float32 y) §source

The positive difference between x and y: max(x - y, 0). Return NaN if x or y is NaN.

template <Denorm denorm_mode>
inline float32 abs(float32 x) §source

Return the absolute value of x: |x|

template <auto N>
inline float32 from_int(int<N> value) §source

Convert a signed integer to a float32.

Parameters

  • auto N
    

    Width of value.

template <auto N>
inline float32 from_uint(uint<N> value) §source

Convert an unsigned integer to a float32.

Parameters

  • auto N
    

    Width of value.

template <auto N>
inline optional<int<N>> to_int(float32 value) §source

Convert a float32 to a signed integer.

Parameters

  • auto N
    

    Width of the signed integer.

template <auto N>
inline optional<uint<N>> to_uint(float32 value) §source

Convert a float32 to an unsigned integer

Parameters

  • auto N
    

    Width of the unsigned integer.