Forrest logo
back to the echo tool

echo:ai:3b3d1

what is a bitwise AND operation?
$ echo $((5 & 3))
try on your machine

The bitwise AND operation compares two numbers bitwise and returns a new number where each bit is 1 only if both bits of the corresponding input numbers are 1. In this example, it would return 1 because binary representation of 5 is 101 and 3 is 011, so bitwise AND results in 001 which is 1 in decimal.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.

Questions that are answered by this command:

  • what is a bitwise AND operation?
back to the echo tool