Skip to main content

Module mathfunc

Module mathfunc 

Source
Expand description

mathfunc submodule. 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_ABS constant.
MF_ACOS
MF_ACOS constant.
MF_ACOSH
MF_ACOSH constant.
MF_ASIN
MF_ASIN constant.
MF_ASINH
MF_ASINH constant.
MF_ATAN
MF_ATAN constant.
MF_ATANH
MF_ATANH constant.
MF_CBRT
MF_CBRT constant.
MF_CEIL
MF_CEIL constant.
MF_COPYSIGN
MF_COPYSIGN constant.
MF_COS
MF_COS constant.
MF_COSH
MF_COSH constant.
MF_ERF
MF_ERF constant.
MF_ERFC
MF_ERFC constant.
MF_EXP
MF_EXP constant.
MF_EXPM1
MF_EXPM1 constant.
MF_FABS
MF_FABS constant.
MF_FLOAT
MF_FLOAT constant.
MF_FLOOR
MF_FLOOR constant.
MF_FMOD
MF_FMOD constant.
MF_GAMMA
MF_GAMMA constant.
MF_HYPOT
MF_HYPOT constant.
MF_ILOGB
MF_ILOGB constant.
MF_INT
MF_INT constant.
MF_ISINF
MF_ISINF constant.
MF_ISNAN
MF_ISNAN constant.
MF_J0
MF_J0 constant.
MF_J1
MF_J1 constant.
MF_JN
MF_JN constant.
MF_LDEXP
MF_LDEXP constant.
MF_LGAMMA
MF_LGAMMA constant.
MF_LOG
MF_LOG constant.
MF_LOG2
MF_LOG2 constant.
MF_LOG1P
MF_LOG1P constant.
MF_LOG10
MF_LOG10 constant.
MF_LOGB
MF_LOGB constant.
MF_NEXTAFTER
MF_NEXTAFTER constant.
MF_RINT
MF_RINT constant.
MF_SCALB
MF_SCALB constant.
MF_SIGNGAM
MF_SIGNGAM constant.
MF_SIN
MF_SIN constant.
MF_SINH
MF_SINH constant.
MF_SQRT
MF_SQRT constant.
MF_TAN
MF_TAN constant.
MF_TANH
MF_TANH constant.
MF_Y0
MF_Y0 constant.
MF_Y1
MF_Y1 constant.
MF_YN
MF_YN constant.
MS_RAND48
MS_RAND48 constant.
TF_INT1
TF_INT1 constant.
TF_INT2
TF_INT2 constant.
TF_NOASS
TF_NOASS constant.
TF_NOCONV
TF_NOCONV constant.

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.