MCPcopy Index your code
hub / github.com/careercup/ctci / setBit

Method setBit

java/Chapter 5/Sample_Code/Sample_Code.java:11–13  ·  view source on GitHub ↗
(int num, int i)

Source from the content-addressed store, hash-verified

9 }
10
11 public static int setBit(int num, int i) {
12 return num | (1 << i);
13 }
14
15 public static int clearBit(int num, int i) {
16 int mask = ~(1 << i);

Callers 1

mainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected