These docs are for v2.0. Click to read the latest docs for v3.0.

Get the exponent of an XFL enclosing number

🚧

Replaced by macro

This function was replaced by a macro. Please use the macro below in your code instead.
To check the validity of the XFL please use float_mantissa in conjunction with this macro.

Concepts

Behaviour

  • Return the exponent part of an XFL as a signed integer

Definition

Because exponents can be negative, and because negatives are reserved for error states, exponents cannot be returned from functions. Therefore this function has become a macro as shown below.

#define float_exponent(f)\
        (((int32_t)(((f) >> 54U) & 0xFFU)) - 97)

Example

int64_t exponent =
    float_exponent(float_one());

Parameters

NameTypeDescription
float1int64_tAn XFL floating point enclosing number