Fixed Point Arithmetic
include/math/fixed.h View source View on GitHubFunctions
Section titled “Functions”fx_parse
Section titled “fx_parse”fx_add
Section titled “fx_add”fx_sub
Section titled “fx_sub”fx_mul
Section titled “fx_mul”fx_div
Section titled “fx_div”fx_from_int
Section titled “fx_from_int”fx_to_int
Section titled “fx_to_int”fx_min
Section titled “fx_min”fx_max
Section titled “fx_max”fx_clamp
Section titled “fx_clamp”fx_pow_i32
Section titled “fx_pow_i32”fx_sqrt
Section titled “fx_sqrt”fx_ceil
Section titled “fx_ceil”fx_floor
Section titled “fx_floor”fx_map
Section titled “fx_map”fx_lerp
Section titled “fx_lerp”fx_round_up
Section titled “fx_round_up”fx_round_down
Section titled “fx_round_down”fx_poly_eval
Section titled “fx_poly_eval”Extended fixed-point math functions implemented in kernel/math/fixed.c
fx_exp
Section titled “fx_exp”fx_sin
Section titled “fx_sin”fx_cos
Section titled “fx_cos”fx_sincos
Section titled “fx_sincos”fx_exp_series
Section titled “fx_exp_series”fx_ln_series
Section titled “fx_ln_series”fx_sin_series
Section titled “fx_sin_series”fx_cos_series
Section titled “fx_cos_series”fx_sincos_series
Section titled “fx_sincos_series”Macros
Section titled “Macros”FX_ZERO
Section titled “FX_ZERO”FX_ONE
Section titled “FX_ONE”FX_HALF
Section titled “FX_HALF”#define FP_PI 3.14159265358979323846 source #define FX(x) source FX_FROM_RATIO
Section titled “FX_FROM_RATIO”#define FX_FROM_RATIO(n, d) source Expansion
#define FX_FROM_RATIO(n, d) ((fx32_32_t) (((__int128) (n) << 32) / (d)))