Skip to main content

math_func

Function math_func 

Source
pub fn math_func(_name: &str, argc: i32, argv: &[mnumber], id: i32) -> mnumber
Expand description

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).

C signature: static mnumber math_func(char *name, int argc, mnumber *argv, int id)

Matches that signature exactly: name is unused (UNUSED in C); argc is the actual argument count; argv is the slice of argument values; id is the MF_* function id ORed with TFLAG() type flags in its high byte. WARNING: param names don’t match C — Rust=(_name, argc, argv, id) vs C=(name, argc, argv, id)