# `neg`

_Negate_
```syntax
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
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](mt-primitives.md).

## Domain and range
```txt
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`

----

[`not`](not.md),
[Subtract](subtract.md)


[Mathematics](math.md)


_Q for Mortals_
[§4.3.2 Not Zero `not`](../learn/q4m/4_Operators.md#432-not-not),
[§4.9.2 Temporal Arithmetic](../learn/q4m/4_Operators.md#492-temporal-arithmetic)
