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)