ITP 165x Lecture 25: Bitwise Operators

53 views2 pages

Document Summary

Itp 165: intro to c++ - lecture 25: bitwise operators. Bitwise operators operate on each bit of binary number(s) in a specific way. We will cover 4 different bitwise operators in c++: Bitwise not operates on a single number, whereas and, or, xor operate between two numbers. Bitwise not flips every bit in a single binary number. So something that was previously a 0 will instead be a 1, and viceversa. In a bitwise and, you line up the binary digits of two numbers. Any places that are a 1 in both numbers are a 1 in the result. In a bitwise or, you line up the binary digits of two numbers. Any places that are a 1 in either of the numbers are a 1 in the result. In a bitwise xor (exclusive or), you line up the binary digits of two numbers.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents