FastLED 3.9.15
Loading...
Searching...
No Matches
Fixed-Point Fractional Types.

Detailed Description

Types for storing fractional data.

Example: if a fract8 has the value "64", that should be interpreted as 64/256ths, or one-quarter.

accumXY types should be interpreted as X bits of integer, and Y bits of fraction.
E.g., accum88 has 8 bits of int, 8 bits of fraction

+ Collaboration diagram for Fixed-Point Fractional Types.:

Classes

union  IEEE754binary32_t
 typedef for IEEE754 "binary32" float type internals More...
 
struct  IEEE754binary32_t.__unnamed0__
 
struct  IEEE754binary32_t.__unnamed1__
 
struct  IEEE754binary32_t.__unnamed2__
 
class  qfx< T, F, I >
 Template class for representing fractional ints. More...
 

Typedefs

typedef uint16_t accum124
 no direct ANSI counterpart. 12 bits int, 4 bits fraction
 
typedef uint32_t accum1616
 ANSI: signed _Accum. 16 bits int, 16 bits fraction.
 
typedef uint16_t accum88
 ANSI: unsigned short _Accum. 8 bits int, 8 bits fraction.
 
typedef uint16_t fract16
 ANSI: unsigned _Fract.
 
typedef uint32_t fract32
 ANSI: unsigned long _Fract. 32 bits int, 32 bits fraction.
 
typedef uint8_t fract8
 ANSI: unsigned short _Fract.
 
typedef qfx< uint16_t, 12, 4 > q124
 A 12.4 integer (12 bits integer, 4 bits fraction)
 
typedef qfx< uint8_t, 4, 4 > q44
 A 4.4 integer (4 bits integer, 4 bits fraction)
 
typedef qfx< uint8_t, 6, 2 > q62
 A 6.2 integer (6 bits integer, 2 bits fraction)
 
typedef qfx< uint16_t, 8, 8 > q88
 A 8.8 integer (8 bits integer, 8 bits fraction)
 
typedef int32_t saccum114
 no direct ANSI counterpart. 1 bit int, 14 bits fraction
 
typedef int32_t saccum1516
 ANSI: signed _Accum. 15 bits int, 16 bits fraction.
 
typedef int16_t saccum78
 ANSI: signed short _Accum. 7 bits int, 8 bits fraction.
 
typedef int16_t sfract15
 ANSI: signed _Fract.
 
typedef int32_t sfract31
 ANSI: signed long _Fract. 31 bits int, 1 bit fraction.
 
typedef int8_t sfract7
 ANSI: signed short _Fract.
 

Functions

template<class T, int F, int I>
static int16_t operator* (int16_t v, qfx< T, F, I > &q)
 
template<class T, int F, int I>
static int32_t operator* (int32_t v, qfx< T, F, I > &q)
 
template<class T, int F, int I>
static uint16_t operator* (uint16_t v, qfx< T, F, I > &q)
 
template<class T, int F, int I>
static uint32_t operator* (uint32_t v, qfx< T, F, I > &q)