div_s

Single quadrant division, that is, both operands are of positive 16-bit fractional values, returning a 16-bit result. If both operands are equal, returns 0x7FFF (occurs naturally).

Note: Does not check for division overflow or division by zero.
Prototype

  Word16 div_s(Word16 s_numerator, Word16 s_denominator)

  

  
Example
short s1=0x2000; /*  0.25 */

short s2=0x4000; /*  0.5  */

short result;



result = div_s(s1,s2);  

// Expected value of result: 0.25/0.5 = 0.5 = 0x4000