Declaration; Available Versions - Freescale Semiconductor DSP56800E User Manual

Mlib
Hide thumbs Also See for DSP56800E:
Table of Contents

Advertisement

2.40.1 Available versions

This function is available in the following versions:
• Fractional output - the output is the fractional portion of the result; the result is
within the range <-1 ; 1). The result may overflow.
The available versions of the
Function name
Input type
MLIB_Rnd_F16l
frac32_t

2.40.2 Declaration

The available
MLIB_Rnd
frac16_t MLIB_Rnd_F16l(frac32_t
2.40.3 Function use
The use of the
MLIB_Rnd
#include "mlib.h"
static
frac32_t
f32Val;
static
frac16_t
f16Result;
void main(void)
{
f32Val = FRAC32(0.85);
/* f16Result = round(f32Val)*/
f16Result = MLIB_Rnd_F16l(f32Val);
}
2.41 MLIB_RndSat
The
MLIB_RndSat
functions round the input to the nearest value to meet the return type's
size. The function saturates the output. See the following equation:
Freescale Semiconductor, Inc.
MLIB_Rnd
function are shown in the following table.
Table 2-40. Function versions
Result type
frac16_t
Rounding of a 32-bit fractional value to a 16-bit fractional value. The
output is within the range <-1 ; 1).
functions have the following declarations:
f32Val)
function is shown in the following example:
/* f32Val = 0.85 */
MLIB User's Guide, Rev. 2, 10/2015
Chapter 2 Algorithms in detail
Description
79

Advertisement

Table of Contents
loading

Table of Contents