Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,11 @@
public static void bitwise(int a, int b){
System.out.println("a AND b: " + (a & b));
System.out.println("a OR b: "+ (a | b));
System.out.println("a XOR b: "+ (a ^ b));
System.out.println("NOT a: " + ~a);
System.out.println("a << b: " + (a << b)); // left shift
System.out.println("a >> b: " + (a >> b)); // arithmetic right shift
System.out.println("a >>> b: " + (a >>> b)); // logical right shift
System.out.println("a rol b: " + Integer.rotateLeft(a, b)); //rotate left, Java 1.5+
System.out.println("a ror b: " + Integer.rotateRight(a, b)); //rotate right, Java 1.5+
}

View file

@ -0,0 +1,4 @@
a <<= 3;
a = a << 3;
a *= 8; //2 * 2 * 2 = 8
a = a * 8;