Thread: numeric AND
View Single Post
  #2   Spotlight this post!  
Unread 25-10-2008, 01:27
Vikesrock's Avatar
Happy Birthday! Vikesrock Vikesrock is offline
Team 2175 Founder
AKA: Kevin O'Connor
no team
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2007
Location: Manchester, NH
Posts: 3,305
Vikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond repute
Send a message via AIM to Vikesrock Send a message via MSN to Vikesrock Send a message via Yahoo to Vikesrock
Re: numeric AND

Quote:
Originally Posted by kamocat View Post
I've seen the AND function used with numeric datatypes, and I really don't understand:
What the heck does it mean like that? Does it convert the integers into boolean arrays, perform the function as if on an array, and then convert them back?

Thanks!
I believe you have the right idea.

All processors store numbers as groups of bits. Performing an AND on numeric datatypes performs the AND operation on these sets of bits. The way the processor sees it no conversion is necessary, the data is already right there in the correct format to do a logical AND bit by bit.

This is often useful to grab parts of a number, usually the most or least significant bits.
__________________


2007 Wisconsin Regional Highest Rookie Seed & Regional Finalists (Thanks 930 & 2039)
2008 MN Regional Semifinalists (Thanks 2472 & 1756)
2009 Northstar Regional Semifinalists (Thanks 171 & 525)

Last edited by Vikesrock : 25-10-2008 at 01:34.