1.4.4.43 libq_q15_Sub_q15_q15 Function
Subtract two 16-bit 2s-complement fractional values
Description
Function libq_q15_Sub_q15_q15:
Subtract two 16-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 MAX16 when an overflow occurs and the result is set to MIN16 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
q15 result a+b on range: MINFRACT16 <= result <= MAXFRACT16
C
q15 libq_q15_Sub_q15_q15 (q15, q15);