Unary Op
Single-operand scalar math. Picks one of nine common one-argument operations on the input.
Node
Interactive preview is available in the interactive reader.
Sockets
a (in)- Float. Operand (default 0).
value (out)- Float. Result.
Parameters
Op- Operation. abs, neg (-a), sqrt, floor, ceil, round, sign (-1/0/1), recip (1/a), sq (a*a). Default: abs.
How It Works
Each operation maps directly onto the underlying Math.* or arithmetic primitive:
abs- Math.abs(a).
neg- -a.
sqrt- Math.sqrt(a). Negative inputs return NaN which the engine treats as 0.
floor, ceil, round- Math.floor / ceil / round.
sign- Math.sign(a) — returns -1, 0 or +1.
recip- 1/a. Division by zero falls back to 0.
sq- a·a. Cheap alternative to pow(a, 2).