LibreOffice Module tools (master) 1
Functions | Variables
fix16.cxx File Reference
#include <tools/fix16.hxx>
Include dependency graph for fix16.cxx:

Go to the source code of this file.

Functions

static uint32_t fix_abs (fix16_t in)
 
fix16_t fix16_mul (fix16_t inArg0, fix16_t inArg1)
 
static uint8_t clz (uint32_t x)
 
fix16_t fix16_div (fix16_t a, fix16_t b)
 

Variables

const fix16_t fix16_minimum = 0x80000000
 
const fix16_t fix16_overflow = 0x80000000
 

Function Documentation

◆ clz()

static uint8_t clz ( uint32_t  x)
static

Definition at line 85 of file fix16.cxx.

References result, and x.

Referenced by fix16_div().

◆ fix16_div()

fix16_t fix16_div ( fix16_t  inArg0,
fix16_t  inArg1 
)

Divides the first given fix16_t by the second and returns the result.

Definition at line 104 of file fix16.cxx.

References a, clz(), div(), fix16_minimum, fix16_overflow, fix_abs(), result, and shift.

◆ fix16_mul()

fix16_t fix16_mul ( fix16_t  inArg0,
fix16_t  inArg1 
)

Multiplies the two given fix16_t's and returns the result.

Definition at line 50 of file fix16.cxx.

References fix16_overflow, and result.

◆ fix_abs()

static uint32_t fix_abs ( fix16_t  in)
inlinestatic

Definition at line 30 of file fix16.cxx.

References fix16_minimum, and in.

Referenced by fix16_div().

Variable Documentation

◆ fix16_minimum

const fix16_t fix16_minimum = 0x80000000

the minimum value of fix16_t

Definition at line 27 of file fix16.cxx.

Referenced by fix16_div(), and fix_abs().

◆ fix16_overflow

const fix16_t fix16_overflow = 0x80000000

the value used to indicate overflows

Definition at line 28 of file fix16.cxx.

Referenced by fix16_div(), and fix16_mul().