12 #include "mozzi_fixmath.h"
60 uint8_t uint8_tRnd(uint8_t min, uint8_t max)
63 seed = (21 * seed + 21);
75 int ipow(
int base,
int exp)
120 uint8_t Q = (uint8_t)((
Q8n8)exponent>>8);
121 uint8_t n = (uint8_t) exponent;
136 root, remainder, place;
142 while (place > remainder)
146 if (remainder >= root + place)
148 remainder = remainder - root - place;
149 root = root + (place << 1);
163 root, remainder, place;
169 while (place > remainder)
173 if (remainder >= root + place)
175 remainder = remainder - root - place;
176 root = root + (place << 1);
#define Q8n8_FIX1
1 in Q8n8 format
uint8_t uint8_tMod(uint8_t n, uint8_t d)
fast uint8_t modulus
uint8_t uint8_tDiv(uint8_t n, uint8_t d)
Fast uint8_t division.
Q16n16 Q16n16_pow2(Q8n8 exponent)
fast replacement for pow(2,x), where x is a Q8n8 fractional fixed-point exponent.
uint16_t Q8n8
unsigned fractional number using 8 integer bits and 8 fractional bits, represents 0 to 255....
uint32_t Q16n16
unsigned fractional number using 16 integer bits and 16 fractional bits, represents 0 to 65535....