FastLED 3.9.7
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

Classes

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

Typedefs

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

Typedef Documentation

◆ accum124

typedef uint16_t accum124

no direct ANSI counterpart. 12 bits int, 4 bits fraction

Definition at line 62 of file types.h.

◆ accum1616

typedef uint32_t accum1616

ANSI: signed _Accum. 16 bits int, 16 bits fraction.

Definition at line 60 of file types.h.

◆ accum88

typedef uint16_t accum88

ANSI: unsigned short _Accum. 8 bits int, 8 bits fraction.

Definition at line 58 of file types.h.

◆ fract16

typedef uint16_t fract16

ANSI: unsigned _Fract.

Range is 0 to 0.99998474121 in steps of 0.00001525878.
Should be interpreted as unsigned 65536ths.

Definition at line 46 of file types.h.

◆ fract32

typedef uint32_t fract32

ANSI: unsigned long _Fract. 32 bits int, 32 bits fraction.

Definition at line 50 of file types.h.

◆ fract8

typedef uint8_t fract8

ANSI: unsigned short _Fract.

Range is 0 to 0.99609375 in steps of 0.00390625.
Should be interpreted as unsigned 256ths.

Definition at line 36 of file types.h.

◆ q124

typedef qfx<uint16_t, 12,4> q124

A 12.4 integer (12 bits integer, 4 bits fraction)

Definition at line 54 of file qfx.h.

◆ q44

typedef qfx<uint8_t, 4,4> q44

A 4.4 integer (4 bits integer, 4 bits fraction)

Definition at line 48 of file qfx.h.

◆ q62

typedef qfx<uint8_t, 6,2> q62

A 6.2 integer (6 bits integer, 2 bits fraction)

Definition at line 50 of file qfx.h.

◆ q88

typedef qfx<uint16_t, 8,8> q88

A 8.8 integer (8 bits integer, 8 bits fraction)

Definition at line 52 of file qfx.h.

◆ saccum114

typedef int32_t saccum114

no direct ANSI counterpart. 1 bit int, 14 bits fraction

Definition at line 63 of file types.h.

◆ saccum1516

typedef int32_t saccum1516

ANSI: signed _Accum. 15 bits int, 16 bits fraction.

Definition at line 61 of file types.h.

◆ saccum78

typedef int16_t saccum78

ANSI: signed short _Accum. 7 bits int, 8 bits fraction.

Definition at line 59 of file types.h.

◆ sfract15

typedef int16_t sfract15

ANSI: signed _Fract.

Range is -0.99996948242 to 0.99996948242 in steps of 0.00003051757.
Should be interpreted as signed 32768ths.

Definition at line 55 of file types.h.

◆ sfract31

typedef int32_t sfract31

ANSI: signed long _Fract. 31 bits int, 1 bit fraction.

Definition at line 48 of file types.h.

◆ sfract7

typedef int8_t sfract7

ANSI: signed short _Fract.

Range is -0.9921875 to 0.9921875 in steps of 0.0078125.
Should be interpreted as signed 128ths.

Definition at line 41 of file types.h.