## Description

The logical unary operator not (**!**) operates on all scalar and vector
built-in types.
For built-in vector types, the operators are applied component-wise.

The result is a scalar signed integer of type `int`

if the source operands
are scalar and a vector signed integer type of the same size as the source
operands if the source operands are vector types.
Vector source operands of type `char`

and *n*`uchar`

return a
*n*`char`

result; vector source operands of type *n*`short`

and
*n*`ushort`

return a *n*`short`

result; vector source operands of type
*n*`int`

, *n*`uint`

and *n*`float`

return an *n*`int`

result; vector
source operands of type *n*`long`

, *n*`ulong`

and *n*`double`

return a
*n*`long`

result.*n*

For scalar types, the result of the logical unary operator is 0 if the value of its operand compares unequal to 0, and 1 if the value of its operand compares equal to 0. For vector types, the unary operator shall return a 0 if the value of its operand compares unequal to 0, and -1 (i.e. all bits set) if the value of its operand compares equal to 0.

## Document Notes

For more information, see the OpenCL C Specification

This page is extracted from the OpenCL C Specification. Fixes and changes should be made to the Specification, not directly.