_Q15sub Function

This function finds the difference of two Q15 values. The function takes care of saturation during overflow and underflow occurrences.

Include

<libq.h>

Prototype

_Q15 _Q15sub(_Q15 x,_Q15 y);

Arguments

x a fixed-point number in Q15 format, which ranges from -215 to 215-1. The value of this argument ranges from -32768 to 32767.
y a fixed-point number in Q15 format, which ranges from -215 to 215-1. The value of this argument ranges from -32768 to 32767.

Return Value

This function returns x minus y in Q15 format. The value ranges from -32768 to 32767.