298. isqrt is std.math.isqrt, an ordinary body, not a compiler builtin (2026-11-22)
- Decision. The call arm, the
Intproperty arm andBuiltin::Isqrtleave the compiler (checker tables, lowering, interpreter, codegen and the C++ runtime'scpl::isqrt).std.math.isqrtbecomes@get pub fn isqrt(self: Int), soisqrt(n),n.isqrtandn.isqrt()all reach it; the prelude imports it. The body is the runtime's: a truncatedsqrtcorrected by multiplication, and the trap keeps its message,isqrt(-4) of a negative number. - Why. Decision 266:
isqrtis derived, not a numeric primitive. Perf gate, 1e8 calls (g++ -O2): builtin 0.17-0.39 s, std body 0.17-0.18 s over 5 runs each. The first body (floorplus division) ran 0.31-0.46 s and was rewritten before landing. - Reverse. Revert the commit; the std body then stays as the reference the builtin is tested against.