1.4.4.47 libq_q31_Add_q31_q31 Function

Add two 32-bit 2s-complement fractional values.

Description

Function libq_q31_Add_q31_q31:

Add two 32-bit 2s-complement fractional (op1 + op2) to produce a 32-bit 2s-complement fractional result with saturation. The saturation is for handling the overflow/underflow cases, where the result is set to MAX32 when an overflow occurs and the result is set to MIN32 when an underflow occurs. This function does not produce any status flag to indicate when an overflow or underflow has occured. It is assumed that the binary point is in exactly the same bit position for both 32-bit inputs and the resulting 32-bit output. This function relates to the ETSI L_add function.

Returns

q31 result a+b on range: MINFRACT32 <= result <= MAXFRACT32

C

q31 libq_q31_Add_q31_q31 (q31, q31);