5.3.73 _Q31add Function

This function finds the sum value of two Q31 values. The function takes care of saturation during overflow and underflow occurrences.

Include

<libq.h>

Prototype

_Q31 _Q31add(_Q31 x, _Q31 y);

Argument

x a fixed-point number in Q31 format, which ranges from -231 to 231-1. The value of this argument ranges from -2147483648 to 2147483647..
y a fixed-point number in Q31 format, which ranges from -231 to 231-1. The value of this argument ranges from -2147483648 to 2147483647..

Return Value

This function returns the sum of x and y in Q31 format. The value ranges from -2147483648 to 2147483647.