blob: 6f9eab9244b3a8307501be8bf3fd257a65d70b75 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
2 string xor_bits(string str1, string str2);
3
4BESCHREIBUNG
5 <str1> und <str2> sind beiden Bitstrings. Das Resultat von xor_bits()
6 ist ein Bitstring mit dem binaeren XOR von <str1> und <str2>, also
7 ein String, in dem ein Bit nur gesetzt ist, wenn es entweder in <str1>
8 oder in <str2> vorkommt, nicht aber in beiden.
9
10BEISPIELE
11 string s1, s2, s3;
12 s1 = set_bit("", 3); s1 = set_bit(s1, 15); -> s1 ist "( ("
13 s2 = set_bit("", 3); s2 = set_bit(s2, 4); -> s2 ist "8"
14 s3 = xor_bits(s1, s2);
15 -> s3 ist "0 (", es sind also das 4. und das 15. Bit gesetzt.
16
17SIEHE AUCH
18 clear_bit(E), set_bit(E), test_bit(E), next_bit(E), last_bit(E)
19 count_bits(E), and_bits(E), or_bits(E), invert_bits(E), copy_bits(E)