1.4.4.19 Fract_XoverY_Q15bfp Function

fract_q15bfp_t Fract_XoverY_Q15bfp(fract_q15bfp_t x, fract_q15bfp_t y )

Summary

Division x/y as Q15 block floating point.

Description

Division x/y as Q15 block floating point.

Preconditions

None.

Parameters

x Numerator as Q15 block floating point

y Denominator as Q15 block floating point

Returns

Ratio x/y as Q15 block floating point.

Remarks

None.

Example

fract_q15_t x,y;

fract_q15bfp_t X, Y, XoverY;

x = 0x1234; _// 4660/32768 = 0.142219_

y = 0x5678; _// 22136/32768 = 0.675537_

X = Fract_Convert_Q15d16ToQ15bfp((fract_q15d16_t)x);

Y = Fract_Convert_Q15d16ToQ15bfp((fract_q15d16_t)y);

XoverY = Fract_XoverY_Q15bfp(X,Y);

_// x/y = 4660/22136 = 6898/32768 = 0.210516_

_// XoverY.m = 0x6BC8 = 27592_

_// XoverY.e = 0xFFFE = -2_

_// XoverY = (27592/32768)>>2 = 0.210510_

C

fract_q15bfp_t Fract_XoverY_Q15bfp (fract_q15bfp_t x , fract_q15bfp_t y );