Chirp SonicLib
4.5.2
|
Functions for performing fixed point arithmetic. https://github.com/dmoulding/log2fix https://github.com/chmike/fpsqrt. More...
#include <invn/soniclib/details/ch_math_utils.h>
Functions | |
fixed_t | FP_log (fixed_t x) |
Find the natural logarithm in UQ16.16 fixed-point format. More... | |
fixed_t | FP_log2 (fixed_t x) |
Find the base 2 logarithm in UQ16.16 fixed-point format. More... | |
fixed_t | FP_sqrt (fixed_t x) |
int32_t | sqrt_int32 (int32_t v) |
Compute the square root of a 32-bit integer. More... | |
Functions for performing fixed point arithmetic. https://github.com/dmoulding/log2fix https://github.com/chmike/fpsqrt.
Integer square root function: Algorithm and code Author Christophe Meessen 1993.
fixed_t FP_log | ( | fixed_t | x | ) |
Find the natural logarithm in UQ16.16 fixed-point format.
x | Find the natural log of the provided number. This number is is UQ16.16 fixed-point format. |
This function is adapted from work by dmoulding with very minor changes. The source for the original function, logfix, can be found here:
fixed_t FP_log2 | ( | fixed_t | x | ) |
Find the base 2 logarithm in UQ16.16 fixed-point format.
x | Find the log base-2 of the provided number. This number is is UQ16.16 fixed-point format. |
This function is adapted from work by dmoulding with very minor changes. The source for the original function, log2fix, can be found here:
int32_t sqrt_int32 | ( | int32_t | v | ) |
Compute the square root of a 32-bit integer.
x | Find the square root of the provided integer. |
This function is adapted from work by chmike with very minor changes. The source for the original function, sqrt_i32, can be found here: