Skip to main content

Module mathfunc

Module mathfunc 

Source
Expand description

Mathematical functions for arithmetic expressions — port of Src/Modules/mathfunc.c.

C source has THREE anonymous enum {} blocks (lines 35, 90, 104) generating int-typed constants — no named C type, so the Rust port mirrors them as pub const ... : i32 = ...; definitions only (rule 1: no Rust-only struct/enum types).

All math-fn dispatch lives in a single math_func() switch, matching the C structure 1:1.

Constants§

MF_ABS
MF_ACOS
MF_ACOSH
MF_ASIN
MF_ASINH
MF_ATAN
MF_ATANH
MF_CBRT
MF_CEIL
MF_COPYSIGN
MF_COS
MF_COSH
MF_ERF
MF_ERFC
MF_EXP
MF_EXPM1
MF_FABS
MF_FLOAT
MF_FLOOR
MF_FMOD
MF_GAMMA
MF_HYPOT
MF_ILOGB
MF_INT
MF_ISINF
MF_ISNAN
MF_J0
MF_J1
MF_JN
MF_LDEXP
MF_LGAMMA
MF_LOG
MF_LOG2
MF_LOG1P
MF_LOG10
MF_LOGB
MF_NEXTAFTER
MF_RINT
MF_SCALB
MF_SIGNGAM
MF_SIN
MF_SINH
MF_SQRT
MF_TAN
MF_TANH
MF_Y0
MF_Y1
MF_YN
MS_RAND48
TF_INT1
TF_INT2
TF_NOASS
TF_NOCONV

Functions§

boot_
Port of boot_(UNUSED(Module m)) from Src/Modules/mathfunc.c:570.
cleanup_
Port of cleanup_(UNUSED(Module m)) from Src/Modules/mathfunc.c:577. C body: return setfeatureenables(m, &module_features, NULL);
enables_
Port of enables_(UNUSED(Module m), UNUSED(int **enables)) from Src/Modules/mathfunc.c:563. C body: return handlefeatures(m, &module_features, enables);
features_
Port of features_(UNUSED(Module m), UNUSED(char ***features)) from Src/Modules/mathfunc.c:555. C body: *features = featuresarray(m, &module_features); return 0;
finish_
Port of finish_(UNUSED(Module m)) from Src/Modules/mathfunc.c:584.
math_func
Port of math_func(UNUSED(char *name), int argc, mnumber *argv, int id) from Src/Modules/mathfunc.c:173. The dispatcher behind every numeric math fn registered via NUMMATHFUNC in mftab[] (mathfunc.c:115-167).
math_string
Port of math_string(UNUSED(char *name), char *arg, int id) from Src/Modules/mathfunc.c:439. The string-arg math-fn dispatcher behind rand48("seedvar") and future string-takers. C signature: static mnumber math_string(char *name, char *arg, int id)
setup_
Port of setup_(UNUSED(Module m)) from Src/Modules/mathfunc.c:548.
tflag
Port of the TFLAG(x) macro from mathfunc.c:113. #define TFLAG(x) ((x) << 8). Shifts the type-flag bits into the high byte of the id arg passed to math_func() so the MF_* numeric ids can occupy the low byte.