Set the mantissa 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_mantissa_set (
    int64_t float1,
    uint64_t mantissa
);

Example

int64_t new_xfl = 
    float_mantissa_set(old_xfl, 1000000000000000ULL);

📘

Hint

Mantissa must be exactly 16 decimal digits.

Parameters

Name

Type

Description

float1

int64_t

An XFL floating point enclosing number

mantissa

uint64_t

The new mantissa to set

Return Code

Type

Description

uint64_t

The new XFL with the updated mantissa

If negative, an error:
INVALID_FLOAT

  • the supplied parameter was not a valid XFL enclosing number

MANTISSA_OVERSIZED

  • the supplied mantissa was too large

MANTISSA_UNDERSIZED

  • the supplied mantissa was too small