neg¶
Negate
neg x neg[x]
Returns the negation of boolean, numeric, char, or temporal x.
A null has no sign, so it is its own negation.
q)neg -1 0 1 2
1 0 -1 -2
q)neg 01001b
0 -1 0 0 -1i
q)neg (0W;-0w;0N) / infinities and a null
-0W
0w
0N
q)neg 2000.01.01 2012.01.01 / negates the underlying data value
2000.01.01 1988.01.01
q)neg "a" / negates the underlying character code
-97i
neg is an atomic function.
neg is a multithreaded primitive.
Domain and range¶
domain: b g x h i j e f c s p m d z n u v t
range: i . i h i j e f i . p m d z n u v t
Range: ihjefpmdznuvt
Q for Mortals
§4.3.2 Not Zero not,
§4.9.2 Temporal Arithmetic