|
Book Section

General Section

Other Sites

|
JavaScript Workshop Forums
| View previous topic :: View next topic |
| Author |
Message |
REDONDOS New member

Joined: 01 Aug 2002 Posts: 2
|
Posted: Thu Aug 01, 2002 2:52 pm Post subject: Problem with a sentence |
|
|
Hello, this is my first post and I'm practically a newbie, the question is:
What does this do?
I don't know what "<<" means... can you help me out?
Thanks.
REDONDOS |
|
| Back to top |
|
 |
mgm Site Admin

Joined: 13 Jul 2002 Posts: 304 Location: Salt Lake City, UT
|
Posted: Fri Aug 02, 2002 4:01 am Post subject: |
|
|
The << is a binary shift operator. Here's Netscape's description of what that means:
| Quote: | | (Left shift) Shifts its first operand in binary representation the number of bits to the left specified in the second operand, shifting in zeros from the right. |
1<<8 is 256, 2<<8 is 512, 0<<8 is zero, and if that makes no sense at all you'll need to learn a bit of binary arithmetic before it will.
I've never had occasion to use binary math in JavaScript, but I'm sure there's a point to it sometimes. _________________ Michael Moncur
Owner and Moderator, The JavaScript Workshop
Read the guidelines before posting: http://www.jsworkshop.com/posting.html |
|
| Back to top |
|
 |
REDONDOS New member

Joined: 01 Aug 2002 Posts: 2
|
Posted: Fri Aug 02, 2002 2:11 pm Post subject: |
|
|
Thanks a lot, man, understood it perfectly.
Where can I read more about binary arithmetic? |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2002 phpBB Group
|
|
(c) 1997-2002 Starling Technologies and
Michael Moncur. Portions (c) Sams Publishing.
|
|
|