Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: problem with while loop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem with while loop



Ahh the joys of DeMorgans Law.
!(A || B) <=> (!A) && (!B)

aaron

On Saturday, September 28, 2002, at 12:40  AM, Nathan Day wrote:

That should be
while ( ([today dayOfWeek] != 2) && ([today dayOfWeek] != 4) )

dayOfWeek can't be both 2 and 4 and so it will always be true that dayOfWeek is != 2 or != 4

On Saturday, September 28, 2002, at 07:05  AM, Jan Van Tol wrote:

while ( ([today dayOfWeek] != 2) || ([today dayOfWeek] != 4) )
{
	// increment here ...
}

Nathan Day
http://homepage.mac.com/nathan_day/
_______________________________________________
studentdev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/studentdev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
studentdev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/studentdev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: problem with while loop (From: Nathan Day <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.