Fixed Point Arithmetic
fx16_16_t fx_add(fx16_16_t a, fx16_16_t b);fx_add referenced types:
fx16_16_t fx_sub(fx16_16_t a, fx16_16_t b);fx_sub referenced types:
fx16_16_t fx_mul(fx16_16_t a, fx16_16_t b);fx_mul referenced types:
fx16_16_t fx_div(fx16_16_t a, fx16_16_t b);fx_div referenced types:
fx16_16_t fx_from_int(int32_t x);fx_from_int referenced types:
int32_t fx_to_int(fx16_16_t x);fx_to_int referenced types:
fx16_16_t fx_from_float(double v);fx_from_float referenced types:
fx16_16_t fx_min(fx16_16_t a, fx16_16_t b);fx_min referenced types:
fx16_16_t fx_max(fx16_16_t a, fx16_16_t b);fx_max referenced types:
fx16_16_t fx_clamp(fx16_16_t x, fx16_16_t lo, fx16_16_t hi);fx_clamp referenced types:
fx16_16_t fx_pow_i32(fx16_16_t base, int exp);fx_pow_i32 referenced types:
fx16_16_t fx_sqrt(fx16_16_t x);fx_sqrt referenced types:
Defines
Section titled “Defines”#define FX_ONE ((fx16_16_t) (1 << 16))#define FX_HALF ((fx16_16_t) (1 << 15))#define FX(x) ((fx16_16_t) ((x) * 65536.0 + 0.5))#define FX_FROM_RATIO(n, d) ((fx16_16_t) (((int64_t) (n) << 16) / (d)))