O'Reilly logo

Learning AWK Programming by Shiwang Kalkhanda

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The compl (num) function

The compl function returns the bitwise complement of numbers specified as an argument. In the complement operation, it converts 0 to 1 and 1 to 0:

0 complement = 1

1 complement = 0

The following complement operation on decimal 5 shows how the compl() function works:

5 = 101

5's complement = 010 which is decimal 2

The usage of a negative argument in any bit-manipulating function is not allowed.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required