Set the sign of an XFL enclosing number

🚧

Warning

This function is used to directly manipulate XFL numbers, however in most cases you will want to use float_set instead

Concepts

Behaviour

  • Return the new XFL as int64_t

Definition

int64_t float_sign_set (
    int64_t float1,
    uint32_t sign 
);

Example

int64_t negative_one = 
    float_sign_set(float_one(), 1);

📘

Hint

The sign bit inside the XFL is the 0 when the XFL is negative, however this function follows the standard computing convention to return 1 if it is negative.

Parameters

Name

Type

Description

float1

int64_t

An XFL floating point enclosing number

sign

uint32_t

The new sign to set. 1 if negative, 0 if positive.

Return Code

Type

Description

int64_t

The new XFL with the updated exponent

If negative, an error:
INVALID_FLOAT

  • the supplied parameter was not a valid XFL enclosing number