Dokumentation zu: and_bits(E)

HR Image

        string and_bits(string str1, string str2)

        <str1> and <str2> are both bitstrings. The result of the function
        is a bitstring with the binary-and of <str1> and <str2>,
        ie. a string in which a bit is set only if both corresponding
        bits in the input strings are set, too.

        string s1, s2, s3;

        s1 = set_bit("", 3); s1 = set_bit(s1, 15);  -> s1 is "( ("
        s2 = set_bit("", 3); s2 = set_bit(s2, 4);   -> s2 is "8"

        s3 = and_bits(s1, s2);

        -> s3 is now "8", ie. a bitstring with bit 3 set only.

        clear_bit(E), set_bit(E), test_bit(E), next_bit(E), last_bit(E),
        count_bits(E), or_bits(E), xor_bits(E), invert_bits(E), copy_bits(E)

Die Seite ist auch in Deutsch vorhanden.

Start » Magierhandbuch » Docu » Efun » And_bits Letzte Generierung: 25.04.2021, 01:58
Email an:
Valid HTML 4.01!