round()
function round(float $num, int $precision = 0, int $mode = 1): float
Rounds a float.
Parameters:
$num(float)$precision(int), default0, optional$mode(int), default1, optional
Returns: float
Availability
- Compiled (AOT): supported by the Elephc code generator.
eval()(magician interpreter): supported — declarative interpreter builtin (crates/elephc-magician/src/interpreter/builtins/math/round.rs).
No examples yet — check examples/ and showcases/ for usage patterns.
Internals
For how round is implemented in the compiler, see the internals page.