View Single Post
  #12   Spotlight this post!  
Unread 17-01-2004, 15:58
Mike Soukup's Avatar
Mike Soukup Mike Soukup is offline
Software guy
FRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Schaumburg, IL
Posts: 797
Mike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond repute
Re: Logical And Bitwise AND

Quote:
Originally Posted by Skabana159
Easy now! He said that it CAN BE USED for the same purpose, not that they are the same thing.
What he means is that a lot of time, either & bitwise or && logical can be used, because both operands are conditionals, thus they are both bits.
Not true. In almost every instance & and && can not be used for the same purpose. The only time they are guaranteed to return the same result is if the two operands are bits.

Quote:
Originally Posted by Atheist
All I was saying is that the two operands can be used to the same end.
Absolutely not true again. They have different meanings. They translate into different machine instructions. They give the same result only for very limited scope.

What everyone is saying is analogous to saying that since 2*2 is equal to 4, and 2 + 2 is also equal to 4, the two operands can both be used to the same end. Just because an operation equates to the same number once does not mean they are the same.