|
G2Basic 0.1.1 (1e793fc)
BASIC interpreter for microcontrollers
|
Build-time choice of built-in functions, with or without libm. More...
Functions | |
| void | g2basic_init_math_functions (void) |
| Register the built-in functions of the selected backend. | |
Build-time choice of built-in functions, with or without libm.
CMake compiles exactly one backend source, selected by G2BASIC_ENABLE_MATH_FUNCTIONS and G2BASIC_ENABLE_MATH:
| Backend | ..._FUNCTIONS | ..._MATH | Registers | libm |
|---|---|---|---|---|
g2basic_math.c | ON | ON | all 13 | yes |
g2basic_math_crude.c | ON | OFF | all 13, approximated | no |
g2basic_math_none.c | OFF | any | min, max | no |
The 13 functions are sin, cos, tan, sqrt, abs, pow, log, log10, exp, floor, ceil, min, and max. pow takes two arguments. min and max take up to eight and return 0 with none. The others take one.
| void g2basic_init_math_functions | ( | void | ) |
Register the built-in functions of the selected backend.
Called by g2basic_init() after it clears all registered functions. Host programs do not call it.