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@+4nSpace:
n(1.5@+20)
See the complexity glossary for what @, w, dw, dbit, n mean.
Source¶
Click to view the macro body
def abs n, x @ negative, end {
.sign n, x, negative, end
negative:
.neg n, x
end:
}
Depends on¶
← Previous: hex.neg
Next: hex.sign_extend →