float_mulratio
Multiply an XFL floating point by a non-XFL numerator and denominator
Concepts
Behaviour
Compute the multiplication of an XFL (xls17) floating point number and the quotient of two integers
Return a new XFL as an int64_t
Definition
C
Example
C
Parameters
float1
int64_t
An XFL floating point enclosing number representing the first operand to the multiplication
round_up
uint32_t
If non-zero all computations will be rounded up
numerator
uint32_t
The numerator of the quotient that the float will be multiplied by
denominator
uint32_t
The denominator of the quotient that the float will be multiplied by
🚧CautionCertain multiplications may overflow, which return with an
INVALID_FLOAT
error. However an underflow returns as XFL Canonical Zero (i.e. enclosing number = 0).
Return Code
int64_t
The 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 multiplication was too large to store in an XFL.
DIVISION_BY_ZERO
- the supplied denominator was zero.
Last updated