tests/cond_xor
raw| 1 | #!/usr/bin/perl |
| 2 | |
| 3 | # Copyright 2002-2026, Paul Johnson ([email protected]) |
| 4 | |
| 5 | # This software is free. It is licensed under the same terms as Perl itself. |
| 6 | |
| 7 | # The latest version of this software should be available from my homepage: |
| 8 | # https://pjcj.net |
| 9 | |
| 10 | use strict; |
| 11 | use warnings; |
| 12 | |
| 13 | my $i = 1; |
| 14 | my $j = 0; |
| 15 | |
| 16 | for my $y (0, 1, 1, 1) { |
| 17 | for my $z (0, 0, 1) { |
| 18 | my $x = $y ^ $z; |
| 19 | $x = ($y xor $z); |
| 20 | |
| 21 | my $p = ($i xor $y); |
| 22 | $p = ($j xor $y); |
| 23 | $p ^= $y; |
| 24 | } |
| 25 | } |