Linux cli command powerof2

➡ A Linux man page (short for manual page) is a form of software documentation found on Linux and Unix-like operating systems. This man-page explains the command powerof2 and provides detailed information about the command powerof2, system calls, library functions, and other aspects of the system, including usage, options, and examples of _. You can access this man page by typing man followed by the powerof2.

NAME 🖥️ powerof2 🖥️

test if a value is a power of 2

LIBRARY

Standard C library (libc)

SYNOPSIS

#include <sys/param.h>
int powerof2(x);

DESCRIPTION

This macro returns true if x is a power of 2, and false otherwise.

0 is considered a power of 2. This can make sense considering wrapping of unsigned integers, and has interesting properties.

RETURN VALUE

True or false, if x is a power of 2 or not, respectively.

STANDARDS

BSD.

CAVEATS

The arguments may be evaluated more than once.

Because this macro is implemented using bitwise operations, some negative values can invoke undefined behavior. For example, the following invokes undefined behavior: powerof2(INT_MIN);. Call it only with unsigned types to be safe.

SEE ALSO

stdc_bit_ceil(3), stdc_bit_floor(3)

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

  █║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌

              ██╗ ██╗ ██████╗  ██████╗ ██╗  ██╗███████╗██████╗
             ████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
             ╚██╔═██╔╝██║  ██║██║   ██║ ╚███╔╝ █████╗  ██║  ██║
             ████████╗██║  ██║██║   ██║ ██╔██╗ ██╔══╝  ██║  ██║
             ╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
              ╚═╝ ╚═╝ ╚═════╝  ╚═════╝ ╚═╝  ╚═╝╚══════╝╚═════╝

               █║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░