Fixed Point Arithmetic  0
Fixed-point math library.
Data Structures | Macros | Typedefs
types.h File Reference

Type definitions for fixed point arithmetic types. More...

#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  mfrac
 16 bit fractional number in Q8.8 format. More...
 
struct  frac
 16 bit fractional number in Q1.15 format. More...
 
struct  dfrac
 32 bit fractional number in Q2.30 format. More...
 
struct  efrac
 32 bit fractional number in Q17.15 format. More...
 

Macros

#define MFRAC_BIT   (16)
 
#define FRAC_BIT   (16)
 
#define DFRAC_BIT   (32)
 
#define EFRAC_BIT   (32)
 
#define MFRAC_1_V   (INT16_MAX >> 8)
 mfrac representing 1. More...
 
#define MFRAC_minus1_V   (INT16_MIN >> 8)
 mfrac representing -1. More...
 
#define MFRAC_MAX_V   INT16_MAX
 Maximum (most positive) value for a frac. More...
 
#define MFRAC_MIN_V   INT16_MIN
 Minimum (most negative) value for a frac. More...
 

Typedefs

typedef int16_t mfrac_base
 
typedef int16_t frac_base
 
typedef int32_t dfrac_base
 
typedef int32_t efrac_base
 
typedef frac frac_s16
 
typedef dfrac frac_s32
 

Detailed Description

Type definitions for fixed point arithmetic types.

Author
Juan I Carrano juan@.nosp@m.carr.nosp@m.ano.c.nosp@m.om.a.nosp@m.r

Definition in file types.h.