MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame^] | 1 | SYNOPSIS |
| 2 | int count_bits(string str); |
| 3 | |
| 4 | BESCHREIBUNG |
| 5 | Diese Funktion zaehlt die Anzahl gesetzer Bits im Bitstring <str> und |
| 6 | liefert die Anzahl als Resultat zurueck. |
| 7 | |
| 8 | BEMERKUNGEN |
| 9 | Arbeitet eigentlich nur sinnvoll auf Bitstrings :) |
| 10 | |
| 11 | BEISPIEL |
| 12 | string s; |
| 13 | s = set_bit("", 3); s = set_bit(s, 15); |
| 14 | count_bits(s) --> liefert 2 |
| 15 | |
| 16 | SIEHE AUCH |
| 17 | clear_bit(E), set_bit(E), test_bit(E), next_bit(E), last_bit(E), |
| 18 | or_bits(E), xor_bits(E), invert_bits(E), copy_bits(E), bitstrings (C) |
| 19 | |
| 20 | 10.Apr.2007 Gloinson |