Not/de: what changed
Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | 1 | Zurück zu den [[Reserved words/de|reservierten Wörtern]]. | |
| 2 | 2 | ||
| 3 | - | ||
| 3 | + | Das reservierte Wort not kann verwendet werden als: | |
| 4 | 4 | ||
| 5 | 5 | - negation eines booleschen Ausdrucks | |
| 6 | 6 | - binäre Negation eines Wertes | |
| 7 | 7 | ||
| 8 | 8 | Beispiel für die Negation eines booleschen Ausdrucks: | |
| 9 | 9 | ||
| 10 | 10 | ``` pascal | |
| 11 | 11 | var | |
| 12 | 12 | intI: Integer; | |
| 13 | 13 | begin | |
| 14 | 14 | ... | |
| 15 | 15 | if not (intI > 2) then ; // Durch das Reservierte Wort not wird das Ergebnis in sein Gegenteil verkehrt | |
| 16 | 16 | // Ist das Ergebnis in der Klammer True dann liefert der not-Operator False | |
| 17 | 17 | // Ist das Ergebnis in der Klammer False dann liefert der not-Operator True | |
| 18 | 18 | ... | |
| 19 | 19 | end; | |
| 20 | 20 | ``` | |
| 21 | 21 | ||
| 22 | 22 | Beispiel für die binäre Negation eines Wertes: | |
| 23 | 23 | ||
| 24 | 24 | Binärdarstellung der Zahl 3: 0000 0011 Mit dem reservierten Wort not wird der Binärwert umgedreht: 1111 1100 | |
| 25 | 25 | ||
| 26 | 26 | ``` pascal | |
| 27 | 27 | var | |
| 28 | 28 | intI: Integer; | |
| 29 | 29 | begin | |
| 30 | 30 | ... | |
| 31 | 31 | intI := ...; | |
| 32 | 32 | ... := not intI; // Dreht den binären Wert der Variablen intI um | |
| 33 | 33 | ... | |
| 34 | 34 | end; | |
| 35 | 35 | ``` | |
| 36 | 36 | ||
| 37 | 37 | --- | |
| 38 | 38 | *From the Free Pascal wiki, page "Not/de", as it stood on 2020-02-21 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
