← board

Abs / Sqr System intrinsics missing

Problem

Abs(x) and Sqr(x) are System intrinsics (no uses) and are unimplemented. (Succ/Pred/Odd were added the same session as pure single-use rewrites; Abs/Sqr are deferred because a naive rewrite is incorrect.)

Why not a trivial rewrite

Fix options

A runtime helper (__pxxAbsInt/__pxxAbsFloat, __pxxSqr*) in the builtin unit (with the usual pre-scan pull on abs(/sqr(), mirroring the string Copy/Delete intrinsics), or an expression-temp mechanism so the argument is evaluated once. Gate: make test + FPC oracle (int + float, negative/zero/positive).

Fix log