hex.abs

x[:n] = |x[:n]| (two’s complement; the minimal value -2^(4n-1) stays itself)

Signature

def abs n, x @ negative, end { ... }

Defined in hex/math_basic.fj — lines 201–206 (view on GitHub).

Complexity

  • Time: 2@+4n

  • Space: n(1.5@+20)

See the complexity glossary for what @, w, dw, dbit, n mean.

Source

Depends on


← Previous: hex.neg Next: hex.sign_extend