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

Add two XFL numbers together

Concepts

Behaviour

  • Compute the addition of two XFL (xls17) floating point numbers
  • Return a new XFL as an int64_t

Definition

int64_t float_sum (
    int64_t float1,
    int64_t float2
);

Example

int64_t two =
    float_sum(float_one(), float_one());

Parameters

NameTypeDescription
float1int64_tAn XFL floating point enclosing number representing the first operand to the addition
float2int64_tAn XFL floating point enclosing number representing the second operand to the addition

📘

Hint

To subtract two floats use float_negate on the second float then use float_sum.

Return Code

TypeDescription
int64_tThe XFL (xls17) enclosing number

If negative, an error:
INVALID_FLOAT
- one of the supplied parameters was not a valid XFL enclosing number

OVERFLOW
- the result of the addition was too large to store in an XFL.