Inline functions

for Zig 0.15.2 Buy

Inline functions

When we use the inline keyword in a function declaration like this:

  inline fn round2(n_x: f32) f32 {

The compiler will replace the function call with the function's body. If the function is simple, this can make the code run faster, since it avoids allocating stack space and performing a jump, as in a normal function call.

Optional values
Libraries
© 2025 - 2026 Zen of Zig