Le 3 août 2011 à 16:40, Thomas Davie a écrit :

> 
> On 3 Aug 2011, at 15:15, Scott Ribe wrote:
> 
>> On Aug 3, 2011, at 7:54 AM, Thomas Davie wrote:
>> 
>>> Not really – both C ands are the same and… they're just operating on 
>>> different representations of booleans.
>> 
>> No, they're not the same at all. One is a bitwise operation on binary ints.
> 
> Yes – it performs the logical and operation on booleans represented by bits 
> (lots of booleans at once in this instance).  The other performs the same 
> logical and operation on booleans represented by entire ints.  Same op, 
> different representations.
> 



They are 2 different operators.

One important difference for instance is that if you write if (a() & b()), both 
a() and b() will always be executed, while if you write if (a() && b()), b() 
will be executed only if a() is true.


-- Jean-Daniel





_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to