Mozzi  alpha 0.01.1t
sound synthesis library for Arduino
 All Classes Functions Typedefs
Defines | Typedefs | Functions
Mozzi fixed point maths functions

Take care when converting that the important bits of your numbers will fit in the types you choose! More...

Defines

#define Q0n7_FIX1   ((Q0n7) 127)
 0.992 in Q0n7 format
#define Q7n8_FIX1   ((Q7n8) 256)
 1 in Q7n8 format
#define Q8n8_FIX1   ((Q8n8) 256)
 1 in Q8n8 format
#define Q23n8_FIX1   ((Q23n8) 256)
 1 in Q23n8 format
#define Q1n14_FIX1   ((Q1n14) 16384)
 1 in Q1n14 format
#define Q1n15_FIX1   ((Q1n15) 32768)
 1 in Q1n15 format
#define Q16n16_FIX1   ((Q16n16) 65536)
 1 in Q16n16 format
#define Q0n15_FIX1   ((Q0n15) 32767)
 0.999 in Q0n15 format
#define Q0n16_FIX1   ((Q0n16) 65535)
 0.999 in Q0n16 format
#define Q15n16_FIX1   ((Q15n16) 65536)
 1 in Q15n16 format
#define Q8n24_FIX1   ((Q8n24) 16777216)
 1 in Q8n24 format
#define Q0n32_FIX1   ((Q0n32) 4294967295)
 0.999999999767169 in Q0n32 format
#define Q3n13_2PI   ((Q3n13) 411775)
 2*PI in Q3n13 format
#define Q16n16_2PI   ((Q16n16) 411775)
 2*PI in Q16n16 format
#define low15bits   ((Q1n15) 32767)
 Useful for keeping the lower 15 bits of a Q1n15 number, using &.
#define Q7n8_multfix(a, b)
 Fast (?) fixed point multiply for Q7n8 fractional numbers.

Typedefs

typedef char Q0n7
 signed fractional number using 7 fractional bits, represents -0.5 to 0.496
typedef char Q7n0
 ordinary old signed Q7n0 char with 0 fractional bits, represents -128 to 127
typedef unsigned char Q0n8
 unsigned fractional number using 8 fractional bits, represents 0.0 to 0.996
typedef unsigned char Q8n0
 normal unsigned char with 0 fractional bits, represents 0.0 to 255.0
typedef unsigned int Q0n16
 unsigned fractional number using 16 fractional bits, represents 0.0 to 0.999
typedef unsigned long Q0n31
 signed number using 0 integer bits and 31 fractional bits, represents -32768 to 32767
typedef int Q7n8
 signed fractional number using 7 integer bits and 8 fractional bits, represents -127.996 to 127.996
typedef unsigned int Q3n13
 unsigned fractional number using 3 integer bits and 13 fractional bits, represents 0 to 7.999
typedef int Q1n14
 signed fractional number using 1 integer bit and 14 fractional bits, represents -1.999 to 1.999
typedef int Q15n0
 signed number using 15 integer bits and 0 fractional bits, represents -2147483648 to 2147483647
typedef unsigned int Q8n8
 unsigned fractional number using 8 integer bits and 8 fractional bits, represents 0 to 255.996
typedef unsigned int Q1n15
 unsigned fractional number using 1 integer bit and 15 fractional bits, represents 0 to 1.999
typedef unsigned int Q16n0
 unsigned number using 16 integer bits and 0 fractional bits, represents 0 to 65536.0
typedef long Q23n8
 signed fractional number using 23 integer bits and 8 fractional bits, represents -8388607.996 to 8388607.996
typedef long Q15n16
 signed fractional number using 15 integer bits and 16 fractional bits, represents -32767.999 to 32767.999
typedef long Q31n0
 signed (normal long int) number using 31 integer bits and 0 fractional bits, represents -2147483648 to 2147483647
typedef unsigned long Q32n0
 unsigned (normal unsigned long int) number using 32 integer bits and 0 fractional bits, represents 0 to 4294967295
typedef unsigned long Q0n32
 unsigned (normal unsigned long int) number using 0 integer bits and 32 fractional bits, represents 0 to 0.999999999767169
typedef unsigned long Q8n24
 signed fractional number using 8 integer bits and 24 fractional bits, represents 0 to 255.999
typedef unsigned long Q24n8
 unsigned fractional number using 24 integer bits and 8 fractional bits, represents 0 to 16777215
typedef unsigned long Q16n16
 unsigned fractional number using 16 integer bits and 16 fractional bits, represents 0 to 65535.999

Functions

Q0n7 float_to_Q0n7 (float a)
 Convert float to Q0n7 fix.
Q0n8 float_to_Q0n8 (float a)
 Convert float to Q0n8 fix.
Q7n8 float_to_Q7n8 (float a)
 Convert float to Q7n8 fix.
Q8n8 float_to_Q8n8 (float a)
 Convert float to Q8n8 fix.
Q1n14 float_to_Q1n14 (float a)
 Convert float to Q1n14 fix.
Q1n15 float_to_Q1n15 (float a)
 Convert float to Q1n15 fix.
Q8n24 float_to_Q8n24 (float a)
 Convert float to Q8n24 fix.
Q23n8 float_to_Q23n8 (float a)
 Convert float to Q23n8 fix.
Q24n8 float_to_Q24n8 (float a)
 Convert float to Q24n8 fix.
Q16n16 float_to_Q16n16 (float a)
 Convert float to Q16n16 fix.
Q0n16 float_to_Q0n16 (float a)
 Convert float to Q0n16 fix.
Q15n16 float_to_Q15n16 (float a)
 Convert float to Q15n16 fix.
Q1n14 Q0n7_to_Q1n14 (Q0n7 a)
 Convert Q0n7 char to Q1n14 fix.
Q15n16 Q0n7_to_Q15n16 (Q0n7 a)
 Convert Q0n7 signed char to Q15n16 fix.
float Q0n7_to_float (Q0n7 a)
 Convert Q0n7 fix to float.
Q1n15 Q0n8_to_Q1n15 (Q0n8 a)
 Convert Q0n8 unsigned char to Q1n15 fix.
Q8n8 Q0n8_to_Q8n8 (Q0n8 a)
 Convert Q0n8 unsigned char to Q8n8 fix.
Q8n24 Q0n8_to_Q8n24 (Q0n8 a)
 Convert Q0n8 unsigned char to Q8n24 fix.
Q24n8 Q0n8_to_Q24n8 (Q0n8 a)
 Convert Q0n8 unsigned char to Q24n8 fix.
Q15n16 Q0n8_to_Q15n16 (Q0n8 a)
 Convert Q0n8 unsigned char to Q15n16 fix.
Q16n16 Q0n8_to_Q16n16 (Q0n8 a)
 Convert Q0n8 unsigned char to Q16n16 fix.
float Q0n8_to_float (Q0n8 a)
 Convert Q0n8 fix to float.
Q7n8 Q7n0_to_Q7n8 (Q7n0 a)
 Convert Q7n0 char to Q7n8 fix.
Q7n8 Q8n0_to_Q7n8 (Q8n0 a)
 Convert Q8n0 unsigned char to Q7n8 fix.
Q8n8 Q8n0_to_Q8n8 (Q8n0 a)
 Convert unsigned char to Q8n8 fix.
Q16n16 Q8n0_to_Q16n16 (Q8n0 a)
 Convert Q8n0 unsigned char to Q16n16 fix.
Q7n0 Q7n8_to_Q7n0 (Q7n8 a)
 Convert Q7n8 fix to Q7n0.
float Q7n8_to_float (Q7n8 a)
 Convert Q7n8 fix to float.
Q8n0 Q8n8_to_Q8n0 (Q8n8 a)
 Convert Q8n8 fix to Q8n0 unsigned char.
Q16n16 Q8n8_to_Q16n16 (Q8n8 a)
 Convert Q8n8 fix to Q16n16 unsigned long.
float Q8n8_to_float (Q8n8 a)
 Convert Q8n8 fix to float.
Q0n7 Q1n14_to_Q0n7 (Q1n14 a)
 Convert Q1n14 fixed to Q0n7 char.
float Q1n14_to_float (Q1n14 a)
 Convert fix to float.
Q0n8 Q1n15_to_Q0n8 (Q1n15 a)
 Convert Q1n15 fixed to Q0n8 unsigned char.
float Q1n15_to_float (Q1n15 a)
 Convert fix to float.
float Q0n16_to_float (Q0n16 a)
 Convert fix to float.
Q15n16 Q15n0_to_Q15n16 (Q15n0 a)
 Convert Q15n0 int to Q15n16 fix.
Q15n16 Q16n0_to_Q15n16 (Q16n0 a)
 Convert Q16n0 unsigned int to Q15n16 fix.
Q23n8 Q16n0_to_Q23n8 (Q16n0 a)
 Convert Q16n0 unsigned int to Q23n8 fixed point signed long.
Q24n8 Q16n0_to_Q24n8 (Q16n0 a)
 Convert Q16n0 unsigned int to Q24n8 fixed point unsigned long.
Q16n16 Q16n0_to_Q16n16 (Q16n0 a)
 Convert Q16n0 unsigned int to Q16n16 fixed point unsigned long.
float Q16n0_to_float (Q16n0 a)
 Convert Q16n0 unsigned int to float.
Q0n8 Q8n24_to_Q0n8 (Q8n24 a)
 Convert Q8n24 fixed to Q0n8 unsigned char.
float Q8n24_to_float (Q8n24 a)
 Convert fix to float.
Q31n0 Q23n8_to_Q31n0 (Q23n8 a)
 Convert Q23n8 fixed to Q31n0 long.
Q16n0 Q23n8_to_Q16n0 (Q23n8 a)
 Convert Q23n8 fixed to Q16n0 unsigned int.
Q15n0 Q23n8_to_Q15n0 (Q23n8 a)
 Convert Q23n8 fixed to Q15n0 signed int.
Q7n8 Q23n8_to_Q7n8 (Q23n8 a)
 Convert Q23n8 fixed to Q7n8 signed int, losing most significant bits.
float Q23n8_to_float (Q23n8 a)
 Convert fix to float.
Q0n8 Q24n8_to_Q0n8 (Q24n8 a)
 Convert Q24n8 fixed to Q0n8 unsigned char.
Q32n0 Q24n8_to_Q32n0 (Q24n8 a)
 Convert Q24n8 fixed to Q32n0 unsigned long.
Q16n16 Q24n8_to_Q16n16 (Q24n8 a)
 Convert Q24n8 fixed to Q16n16 unsigned long.
float Q24n8_to_float (Q24n8 a)
 Convert fix to float.
Q0n8 Q15n16_to_Q0n8 (Q15n16 a)
 Convert Q15n16 fixed to Q0n8 unsigned char.
Q15n0 Q15n16_to_Q15n0 (Q15n16 a)
 Convert Q15n16 fixed to Q15n0 signed int.
Q7n8 Q15n16_to_Q7n8 (Q15n16 a)
 Convert Q15n16 fixed to Q7n8 signed int, keeping middle bits only.
float Q15n16_to_float (Q15n16 a)
 Convert fix to float.
Q0n8 Q16n16_to_Q0n8 (Q16n16 a)
 Convert Q16n16 fixed to Q0n8 unsigned char.
Q16n0 Q16n16_to_Q16n0 (Q16n16 a)
 Convert Q16n16 fixed to Q16n0 unsigned int.
Q24n8 Q16n16_to_Q24n8 (Q16n16 a)
 Convert Q16n16 fixed to Q24n8 unsigned long.
float Q16n16_to_float (Q16n16 a)
 Convert fix to float.
int ipow (int base, int exp)
Q16n16 Q16n16_pow2 (Q8n8 exponent)
 This is a fast replacement for pow(2,x), where x is a fractional number in Q8n8 fixed-point exponent.
unsigned char byteMod (unsigned char n, unsigned char d)
unsigned char byteDiv (unsigned char n, unsigned char d)
unsigned char byteRnd (unsigned char min, unsigned char max)

Detailed Description

Take care when converting that the important bits of your numbers will fit in the types you choose!

Note:
Timing: converting between fixed and float 10-12us, converting between fixed types about 1us.

Define Documentation

#define Q7n8_multfix (   a,
 
)
Value:
({            \
int prod, val1=a, val2=b ;    \
__asm__ __volatile__ (    \
                "muls %B1, %B2  \n\t"   \
                "mov %B0, r0 \n\t"                 \
                "mul %A1, %A2\n\t"                 \
                "mov %A0, r1 \n\t"   \
                "mulsu %B1, %A2 \n\t"   \
                "add %A0, r0  \n\t"     \
                "adc %B0, r1 \n\t"     \
                "mulsu %B2, %A1 \n\t"   \
                "add %A0, r0 \n\t"     \
                "adc %B0, r1  \n\t"    \
                "clr r1  \n\t"                     \
                : "=&d" (prod)     \
                : "a" (val1), "a" (val2)  \
                  );        \
  prod;        \
})

Fast (?) fixed point multiply for Q7n8 fractional numbers.

Interesting: this is slower than doing ((long)a*b)>>16. Timing with an oscilloscope shows: p = Q7n8_multfix(a,b); // 1.52ms p = ((long)a*b)>>16; // 560 to 640 us

Parameters:
aQ7n8 format multiplicand
bQ7n8 format multiplier
Returns:
a Q7n8 format product

Definition at line 281 of file fixedMath.h.


Function Documentation

Q0n16 float_to_Q0n16 ( float  a) [inline]

Convert float to Q0n16 fix.

Parameters:
ais a float

Definition at line 101 of file fixedMath.h.

Q0n7 float_to_Q0n7 ( float  a) [inline]

Convert float to Q0n7 fix.

Parameters:
ais a float

Definition at line 71 of file fixedMath.h.

Q0n8 float_to_Q0n8 ( float  a) [inline]

Convert float to Q0n8 fix.

Parameters:
ais a float

Definition at line 74 of file fixedMath.h.

Q15n16 float_to_Q15n16 ( float  a) [inline]

Convert float to Q15n16 fix.

Parameters:
ais a float

Definition at line 104 of file fixedMath.h.

Q16n16 float_to_Q16n16 ( float  a) [inline]

Convert float to Q16n16 fix.

Parameters:
ais a float

Definition at line 98 of file fixedMath.h.

Q1n14 float_to_Q1n14 ( float  a) [inline]

Convert float to Q1n14 fix.

Parameters:
ais a float

Definition at line 83 of file fixedMath.h.

Q1n15 float_to_Q1n15 ( float  a) [inline]

Convert float to Q1n15 fix.

Parameters:
ais a float

Definition at line 86 of file fixedMath.h.

Q23n8 float_to_Q23n8 ( float  a) [inline]

Convert float to Q23n8 fix.

Parameters:
ais a float

Definition at line 92 of file fixedMath.h.

Q24n8 float_to_Q24n8 ( float  a) [inline]

Convert float to Q24n8 fix.

Parameters:
ais a float

Definition at line 95 of file fixedMath.h.

Q7n8 float_to_Q7n8 ( float  a) [inline]

Convert float to Q7n8 fix.

Parameters:
ais a float

Definition at line 77 of file fixedMath.h.

Q8n24 float_to_Q8n24 ( float  a) [inline]

Convert float to Q8n24 fix.

Parameters:
ais a float

Definition at line 89 of file fixedMath.h.

Q8n8 float_to_Q8n8 ( float  a) [inline]

Convert float to Q8n8 fix.

Parameters:
ais a float

Definition at line 80 of file fixedMath.h.

float Q0n16_to_float ( Q0n16  a) [inline]

Convert fix to float.

Parameters:
ais a Q0n16 unsigned int

Definition at line 185 of file fixedMath.h.

float Q0n7_to_float ( Q0n7  a) [inline]

Convert Q0n7 fix to float.

Parameters:
ais a Q0n7 char

Definition at line 114 of file fixedMath.h.

Q15n16 Q0n7_to_Q15n16 ( Q0n7  a) [inline]

Convert Q0n7 signed char to Q15n16 fix.

Parameters:
ais a Q0n7 signed char

Definition at line 111 of file fixedMath.h.

Q1n14 Q0n7_to_Q1n14 ( Q0n7  a) [inline]

Convert Q0n7 char to Q1n14 fix.

Parameters:
ais a Q0n7 char

Definition at line 108 of file fixedMath.h.

float Q0n8_to_float ( Q0n8  a) [inline]

Convert Q0n8 fix to float.

Parameters:
ais a Q0n8 unsigned char

Definition at line 136 of file fixedMath.h.

Q15n16 Q0n8_to_Q15n16 ( Q0n8  a) [inline]

Convert Q0n8 unsigned char to Q15n16 fix.

Parameters:
ais a Q0n8 unsigned char

Definition at line 130 of file fixedMath.h.

Q16n16 Q0n8_to_Q16n16 ( Q0n8  a) [inline]

Convert Q0n8 unsigned char to Q16n16 fix.

Parameters:
ais a Q0n8 unsigned char

Definition at line 133 of file fixedMath.h.

Q1n15 Q0n8_to_Q1n15 ( Q0n8  a) [inline]

Convert Q0n8 unsigned char to Q1n15 fix.

Parameters:
ais a Q0n8 unsigned char

Definition at line 118 of file fixedMath.h.

Q24n8 Q0n8_to_Q24n8 ( Q0n8  a) [inline]

Convert Q0n8 unsigned char to Q24n8 fix.

Parameters:
ais a Q0n8 unsigned char

Definition at line 127 of file fixedMath.h.

Q8n24 Q0n8_to_Q8n24 ( Q0n8  a) [inline]

Convert Q0n8 unsigned char to Q8n24 fix.

Parameters:
ais a Q0n8 unsigned char

Definition at line 124 of file fixedMath.h.

Q8n8 Q0n8_to_Q8n8 ( Q0n8  a) [inline]

Convert Q0n8 unsigned char to Q8n8 fix.

Parameters:
ais a Q0n8 unsigned char

Definition at line 121 of file fixedMath.h.

Q15n16 Q15n0_to_Q15n16 ( Q15n0  a) [inline]

Convert Q15n0 int to Q15n16 fix.

Parameters:
ais a Q15n0 int

Definition at line 189 of file fixedMath.h.

float Q15n16_to_float ( Q15n16  a) [inline]

Convert fix to float.

Parameters:
ais a Q15n16 signed long

Definition at line 256 of file fixedMath.h.

Q0n8 Q15n16_to_Q0n8 ( Q15n16  a) [inline]

Convert Q15n16 fixed to Q0n8 unsigned char.

Only for positive values!

Parameters:
ais a Q15n16 signed long

Definition at line 247 of file fixedMath.h.

Q15n0 Q15n16_to_Q15n0 ( Q15n16  a) [inline]

Convert Q15n16 fixed to Q15n0 signed int.

Parameters:
ais a Q15n16 signed long

Definition at line 250 of file fixedMath.h.

Q7n8 Q15n16_to_Q7n8 ( Q15n16  a) [inline]

Convert Q15n16 fixed to Q7n8 signed int, keeping middle bits only.

Parameters:
ais a Q15n16 signed long.

Definition at line 253 of file fixedMath.h.

float Q16n0_to_float ( Q16n0  a) [inline]

Convert Q16n0 unsigned int to float.

Parameters:
ais a Q16n0 unsigned int

Definition at line 205 of file fixedMath.h.

Q15n16 Q16n0_to_Q15n16 ( Q16n0  a) [inline]

Convert Q16n0 unsigned int to Q15n16 fix.

Parameters:
ais a Q16n0 unsigned int

Definition at line 193 of file fixedMath.h.

Q16n16 Q16n0_to_Q16n16 ( Q16n0  a) [inline]

Convert Q16n0 unsigned int to Q16n16 fixed point unsigned long.

Parameters:
ais a Q16n0 unsigned int

Definition at line 202 of file fixedMath.h.

Q23n8 Q16n0_to_Q23n8 ( Q16n0  a) [inline]

Convert Q16n0 unsigned int to Q23n8 fixed point signed long.

Parameters:
ais a Q16n0 unsigned int

Definition at line 196 of file fixedMath.h.

Q24n8 Q16n0_to_Q24n8 ( Q16n0  a) [inline]

Convert Q16n0 unsigned int to Q24n8 fixed point unsigned long.

Parameters:
ais a Q16n0 unsigned int

Definition at line 199 of file fixedMath.h.

Q16n16 Q16n16_pow2 ( Q8n8  exponent)

This is a fast replacement for pow(2,x), where x is a fractional number in Q8n8 fixed-point exponent.

It's less accurate than pow(2,x), but useful where a tradeoff between accuracy and speed is required to keep audio from glitching.

Parameters:
exponentin Q8n8 format.
Returns:
pow(2,x) in Q16n16 format.
Todo:
Q16n16_pow2() accuracy needs more attention.

Definition at line 89 of file fixedMath.cpp.

float Q16n16_to_float ( Q16n16  a) [inline]

Convert fix to float.

Parameters:
ais a Q16n16 unsigned long

Definition at line 269 of file fixedMath.h.

Q0n8 Q16n16_to_Q0n8 ( Q16n16  a) [inline]

Convert Q16n16 fixed to Q0n8 unsigned char.

Parameters:
ais a Q16n16 unsigned long

Definition at line 260 of file fixedMath.h.

Q16n0 Q16n16_to_Q16n0 ( Q16n16  a) [inline]

Convert Q16n16 fixed to Q16n0 unsigned int.

Parameters:
ais a Q16n16 unsigned long

Definition at line 263 of file fixedMath.h.

Q24n8 Q16n16_to_Q24n8 ( Q16n16  a) [inline]

Convert Q16n16 fixed to Q24n8 unsigned long.

Parameters:
ais a Q16n16 unsigned long

Definition at line 266 of file fixedMath.h.

float Q1n14_to_float ( Q1n14  a) [inline]

Convert fix to float.

Parameters:
ais an int

Definition at line 174 of file fixedMath.h.

Q0n7 Q1n14_to_Q0n7 ( Q1n14  a) [inline]

Convert Q1n14 fixed to Q0n7 char.

Parameters:
ais a Q1n14 int

Definition at line 171 of file fixedMath.h.

float Q1n15_to_float ( Q1n15  a) [inline]

Convert fix to float.

Parameters:
ais a Q1n15 unsigned int

Definition at line 181 of file fixedMath.h.

Q0n8 Q1n15_to_Q0n8 ( Q1n15  a) [inline]

Convert Q1n15 fixed to Q0n8 unsigned char.

Only for positive values!

Parameters:
ais a Q1n15 unsigned int

Definition at line 178 of file fixedMath.h.

float Q23n8_to_float ( Q23n8  a) [inline]

Convert fix to float.

Parameters:
ais a Q23n8 signed long

Definition at line 230 of file fixedMath.h.

Q15n0 Q23n8_to_Q15n0 ( Q23n8  a) [inline]

Convert Q23n8 fixed to Q15n0 signed int.

Parameters:
ais a Q23n8 long

Definition at line 223 of file fixedMath.h.

Q16n0 Q23n8_to_Q16n0 ( Q23n8  a) [inline]

Convert Q23n8 fixed to Q16n0 unsigned int.

Positive values only.

Parameters:
ais a Q23n8 long

Definition at line 220 of file fixedMath.h.

Q31n0 Q23n8_to_Q31n0 ( Q23n8  a) [inline]

Convert Q23n8 fixed to Q31n0 long.

Parameters:
ais a Q23n8 long

Definition at line 217 of file fixedMath.h.

Q7n8 Q23n8_to_Q7n8 ( Q23n8  a) [inline]

Convert Q23n8 fixed to Q7n8 signed int, losing most significant bits.

Parameters:
ais a Q23n8 signed long.

Definition at line 226 of file fixedMath.h.

float Q24n8_to_float ( Q24n8  a) [inline]

Convert fix to float.

Parameters:
ais a Q24n8 unsigned long

Definition at line 243 of file fixedMath.h.

Q0n8 Q24n8_to_Q0n8 ( Q24n8  a) [inline]

Convert Q24n8 fixed to Q0n8 unsigned char.

Parameters:
ais a Q24n8 unsigned long

Definition at line 234 of file fixedMath.h.

Q16n16 Q24n8_to_Q16n16 ( Q24n8  a) [inline]

Convert Q24n8 fixed to Q16n16 unsigned long.

Parameters:
ais a Q24n8 unsigned long

Definition at line 240 of file fixedMath.h.

Q32n0 Q24n8_to_Q32n0 ( Q24n8  a) [inline]

Convert Q24n8 fixed to Q32n0 unsigned long.

Parameters:
ais a Q24n8 unsigned long

Definition at line 237 of file fixedMath.h.

Q7n8 Q7n0_to_Q7n8 ( Q7n0  a) [inline]

Convert Q7n0 char to Q7n8 fix.

Parameters:
ais a char

Definition at line 140 of file fixedMath.h.

float Q7n8_to_float ( Q7n8  a) [inline]

Convert Q7n8 fix to float.

Parameters:
ais a Q7n8 int

Definition at line 157 of file fixedMath.h.

Q7n0 Q7n8_to_Q7n0 ( Q7n8  a) [inline]

Convert Q7n8 fix to Q7n0.

Parameters:
ais a Q7n8 int

Definition at line 154 of file fixedMath.h.

Q16n16 Q8n0_to_Q16n16 ( Q8n0  a) [inline]

Convert Q8n0 unsigned char to Q16n16 fix.

Parameters:
ais a Q8n0 unsigned char

Definition at line 150 of file fixedMath.h.

Q7n8 Q8n0_to_Q7n8 ( Q8n0  a) [inline]

Convert Q8n0 unsigned char to Q7n8 fix.

Parameters:
ais a Q8n0 unsigned char

Definition at line 144 of file fixedMath.h.

Q8n8 Q8n0_to_Q8n8 ( Q8n0  a) [inline]

Convert unsigned char to Q8n8 fix.

Parameters:
ais a Q8n0 unsigned char

Definition at line 147 of file fixedMath.h.

float Q8n24_to_float ( Q8n24  a) [inline]

Convert fix to float.

Parameters:
ais a Q8n24 unsigned long

Definition at line 213 of file fixedMath.h.

Q0n8 Q8n24_to_Q0n8 ( Q8n24  a) [inline]

Convert Q8n24 fixed to Q0n8 unsigned char.

Parameters:
ais a Q8n24 unsigned long

Definition at line 210 of file fixedMath.h.

float Q8n8_to_float ( Q8n8  a) [inline]

Convert Q8n8 fix to float.

Parameters:
ais a Q8n8 unsigned int

Definition at line 167 of file fixedMath.h.

Q16n16 Q8n8_to_Q16n16 ( Q8n8  a) [inline]

Convert Q8n8 fix to Q16n16 unsigned long.

Parameters:
ais a Q8n8 unsigned int

Definition at line 164 of file fixedMath.h.

Q8n0 Q8n8_to_Q8n0 ( Q8n8  a) [inline]

Convert Q8n8 fix to Q8n0 unsigned char.

Parameters:
ais a Q8n8 unsigned int

Definition at line 161 of file fixedMath.h.