NMSIS-DSP  Version 1.2.0
NMSIS DSP Software Library
Fixed point division

Functions

riscv_status riscv_divide_q15 (q15_t numerator, q15_t denominator, q15_t *quotient, int16_t *shift)
 Fixed point division. More...
 
riscv_status riscv_divide_q31 (q31_t numerator, q31_t denominator, q31_t *quotient, int16_t *shift)
 Fixed point division. More...
 

Detailed Description

Function Documentation

◆ riscv_divide_q15()

riscv_status riscv_divide_q15 ( q15_t  numerator,
q15_t  denominator,
q15_t *  quotient,
int16_t *  shift 
)

Fixed point division.

Parameters
[in]numeratorNumerator
[in]denominatorDenominator
[out]quotientQuotient value normalized between -1.0 and 1.0
[out]shiftShift left value to get the unnormalized quotient
Returns
error status

When dividing by 0, an error RISCV_MATH_NANINF is returned. And the quotient is forced to the saturated negative or positive value.

◆ riscv_divide_q31()

riscv_status riscv_divide_q31 ( q31_t  numerator,
q31_t  denominator,
q31_t *  quotient,
int16_t *  shift 
)

Fixed point division.

Parameters
[in]numeratorNumerator
[in]denominatorDenominator
[out]quotientQuotient value normalized between -1.0 and 1.0
[out]shiftShift left value to get the unnormalized quotient
Returns
error status

When dividing by 0, an error RISCV_MATH_NANINF is returned. And the quotient is forced to the saturated negative or positive value.