LoginSignup
2
3

More than 5 years have passed since last update.

キャレットで 排他的論理和 (XOR)

Last updated at Posted at 2016-03-08

(タイトルを変更)

$ for i in $(seq 1 10) ; do  for j in $(seq 1 10) ; do echo $i^$j = $(($i ^ $j)) ; done ; done
1^1 = 0
1^2 = 3
1^3 = 2
1^4 = 5
1^5 = 4
1^6 = 7
1^7 = 6
1^8 = 9
1^9 = 8
1^10 = 11
2^1 = 3
2^2 = 0
2^3 = 1
2^4 = 6
2^5 = 7
2^6 = 4
2^7 = 5
2^8 = 10
2^9 = 11
2^10 = 8
3^1 = 2
3^2 = 1
3^3 = 0
3^4 = 7
3^5 = 6
3^6 = 5
3^7 = 4
3^8 = 11
3^9 = 10
3^10 = 9
4^1 = 5
4^2 = 6
4^3 = 7
4^4 = 0
4^5 = 1
4^6 = 2
4^7 = 3
4^8 = 12
4^9 = 13
4^10 = 14
5^1 = 4
5^2 = 7
5^3 = 6
5^4 = 1
5^5 = 0
5^6 = 3
5^7 = 2
5^8 = 13
5^9 = 12
5^10 = 15
6^1 = 7
6^2 = 4
6^3 = 5
6^4 = 2
6^5 = 3
6^6 = 0
6^7 = 1
6^8 = 14
6^9 = 15
6^10 = 12
7^1 = 6
7^2 = 5
7^3 = 4
7^4 = 3
7^5 = 2
7^6 = 1
7^7 = 0
7^8 = 15
7^9 = 14
7^10 = 13
8^1 = 9
8^2 = 10
8^3 = 11
8^4 = 12
8^5 = 13
8^6 = 14
8^7 = 15
8^8 = 0
8^9 = 1
8^10 = 2
9^1 = 8
9^2 = 11
9^3 = 10
9^4 = 13
9^5 = 12
9^6 = 15
9^7 = 14
9^8 = 1
9^9 = 0
9^10 = 3
10^1 = 11
10^2 = 8
10^3 = 9
10^4 = 14
10^5 = 15
10^6 = 12
10^7 = 13
10^8 = 2
10^9 = 3
10^10 = 0
$

キャレット、なに。

2
3
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3