← All docs
mt_rand() — internals
Compiler internals for mt_rand(): lowering path, type checks, and runtime helpers.
mt_rand() — internals
Where it lives
- Signature:
src/builtins/math/mt_rand.rs - Lowering:
src/codegen/lower_inst/builtins/math/random.rs:21 (lower_rand) - Function symbol:
lower_rand()
Lowering notes
- Lowers
rand()andmt_rand()with either zero args or an inclusive range.
Runtime helpers
The following runtime helpers are referenced:
__rt_random_u32
Signature summary
function mt_rand(int $min, int $max): int
What the type checker enforces
- Arity: takes exactly 2 arguments.
Eval interpreter (magician)
- Declaration:
crates/elephc-magician/src/interpreter/builtins/math/mt_rand.rs(eval_builtin!) - Dispatch hooks:
direct,values