Jump to main content

##

# 3.11.6 Q15_RIGHT_SHIFT Macro

## C

    #define   Q15_RIGHT_SHIFT( x, y)   (int16_t)( x  >> y )

## Summary

Performs right bit shift operation on a Q15 fixed-point format value.

## Description

This macro performs right bit shift operation on a Q15 fixed-point format value.

## Example

    int16_t a = 0x4000;  // Example Q15 value (0.5 in Q15 format)
    int16_t result = Q15_RIGHT_SHIFT(a, 2); // Shift right by 2 bits

## Remarks

None