Einzelnen Beitrag anzeigen
Alt 18.11.2005, 14:26   #2
jak
Inventar
 
Registriert seit: 13.06.2001
Beiträge: 1.830


Standard

Die Abbruchbedingung ist, daß ((a == 0) && (b==0)), d.h. man könnte schreiben
while(!((a == 0) && (b==0))){
...
}
das ist aber das selbe wie
(a!=0) || (b!=0).
Beim verneinen von Aussagen wird alles umgekehrt, aus && wird also ||.
Tabelle
Code:
|A|B|(a == 0) && (b==0)|(a!=0) || (b!=0)
|1|0|(0)&&(1) = 0      |(1)||(0) = 1
|1|1|(0)&&(0) = 0      |(1)||(1) = 1
|0|0|(1)&&(1) = 1      |(0)||(0) = 0
|0|1|(1)&&(0) = 0      |(0)||(1) = 1
Wie du siehst ist also !((a == 0) && (b==0)) das selbe wie ((a!=0) || (b!=0)).

jak
____________________________________
Join the DNRC | Godwin\'s Law (thx@stona)
Documentation is like sex: If it\'s good, it\'s very, very good. If it\'s bad, it\'s better than nothing.
\"In theory, theory and practice are the same. In practice, they are not\" (Lawrence Berra)
jak ist offline   Mit Zitat antworten