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

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

Typedefs

typedef uint8_t fract8
 ANSI: unsigned short _Fract.
 
typedef int8_t sfract7
 ANSI: signed short _Fract.
 
typedef uint16_t fract16
 ANSI: unsigned _Fract.
 
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 q< uint8_t, 4, 4 > q44
 A 4.4 integer (4 bits integer, 4 bits fraction)
 
typedef q< uint8_t, 6, 2 > q62
 A 6.2 integer (6 bits integer, 2 bits fraction)
 
typedef q< uint16_t, 8, 8 > q88
 A 8.8 integer (8 bits integer, 8 bits fraction)
 
typedef q< uint16_t, 12, 4 > q124
 A 12.4 integer (12 bits integer, 4 bits fraction)
 

Typedef Documentation

◆ accum124

typedef uint16_t accum124

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

Definition at line 424 of file lib8tion.h.

◆ accum1616

typedef uint32_t accum1616

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

Definition at line 422 of file lib8tion.h.

◆ accum88

typedef uint16_t accum88

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

Definition at line 420 of file lib8tion.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 412 of file lib8tion.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 402 of file lib8tion.h.

◆ q124

typedef q<uint16_t, 12,4> q124

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

Definition at line 937 of file lib8tion.h.

◆ q44

typedef q<uint8_t, 4,4> q44

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

Definition at line 931 of file lib8tion.h.

◆ q62

typedef q<uint8_t, 6,2> q62

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

Definition at line 933 of file lib8tion.h.

◆ q88

typedef q<uint16_t, 8,8> q88

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

Definition at line 935 of file lib8tion.h.

◆ saccum114

typedef int32_t saccum114

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

Definition at line 425 of file lib8tion.h.

◆ saccum1516

typedef int32_t saccum1516

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

Definition at line 423 of file lib8tion.h.

◆ saccum78

typedef int16_t saccum78

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

Definition at line 421 of file lib8tion.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 417 of file lib8tion.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 407 of file lib8tion.h.