1.4.4.58 libq_q31_Sub_q31_q31 Function

Subtract two 32-bit 2s-complement fractional values

Description

Function libq_q31_Sub_q31_q31:

Subtract two 32-bit 2s-complement fractional (op1 - op2) to produce a 16-bit 2s-complement fractional difference 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 16-bit inputs and the resulting 16-bit output. This function relates to the ETSI sub function.

Returns

q31 result a-b on range: MINFRACT31 <= result <= MAXFRACT31

C

q31 libq_q31_Sub_q31_q31 (q31, q31);