float_exponent
Concepts
Section titled “Concepts”Behaviour
Section titled “Behaviour”- Return the exponent part of an XFL as a signed integer
Definition
Section titled “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)
const float_exponent = (f) => (Number(((f) >> 54n) & 0xFFn) - 97)
Example
Section titled “Example”int64_t exponent = float_exponent(float_one());
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
float1 | int64_t | An XFL floating point enclosing number |