Functions | |
static Byte | D4D_Divide8 (Word num, Byte div) |
Fast 16/8=8 divide operation with rounding and saturation. More... | |
static Word | D4D_Divide16 (LWord num, Word div) |
Byte | D4D_MulDivUU8 (Byte u1, Byte u2, Byte d) |
Simple proportion unsigned calculation - 8 bit. More... | |
sByte | D4D_MulDivSU8 (sByte s, Byte u, Byte d) |
Simple proportion signed calculation - 8 bit. More... | |
Word | D4D_MulDivUU16 (Word u1, Word u2, Word d) |
Simple proportion unsigned calculation - 16 bit. More... | |
sWord | D4D_MulDivSU16 (sWord s, Word u, Word d) |
Simple proportion signed calculation - 8 bit. More... | |
Byte | D4D_Abs (sByte num) |
Calculation of absolute value - 8 bit. More... | |
Word | D4D_Abs16 (sWord num) |
Calculation of absolute value - 16 bit. More... | |
LWord | D4D_Abs32 (sLWord num) |
Calculation of absolute value - 32 bit. More... | |
Word | D4D_LimitU16 (Word val, Word min, Word max) |
Calculation of limitation value (unsigned) - 16 bit. More... | |
sWord | D4D_LimitS16 (sWord val, sWord min, sWord max) |
Calculation of limitation value (signed) - 16 bit. More... | |
Byte | D4D_LimitU8 (Byte val, Byte min, Byte max) |
Calculation of limitation value (unsigned) - 8 bit. More... | |
sByte | D4D_LimitS8 (sByte val, sByte min, sByte max) |
Calculation of limitation value (signed) - 8 bit. More... | |
sByte | D4D_Sin (Byte x) |
Sine calculation using lookup table. More... | |
sByte | D4D_Cos (Byte x) |
Cosine calculation using lookup table. More... | |
Variables | |
const sByte | d4d_sinTbl [64] |
Fast 16/8=8 divide operation with rounding and saturation.
num | The 16-bit numerator to be divided |
div | The 8-bit denominator |
This function divides a given 16-bit value by a 8-bit divisor and returns 8-bit quotient. Half of the divisor is added to divident before the division so the result is rounded.
Definition at line 138 of file d4d_math.c.
const sByte d4d_sinTbl[64] |
Definition at line 49 of file d4d_math.c.