Jump to content

Recommended Posts

lol you just need to echo $i bro and you will find out hehe

 

echo 16 << 4;

 

hahaha, I should have tried that, yes it is 256....I just want to make sure I get my facts straight, I'm

basically saying, 16 to the power of 2, four times?

 

16 * 2 = 32

32 * 2 = 64

64 * 2 = 128

128 * 2 = 256

 

 

Link to comment
https://forums.phpfreaks.com/topic/145457-left-shift-operator/#findComment-763616
Share on other sites

Yeah :-)

And you can also use the pow(x,y) function to do that

 

When I use that function, I get 65536 instead.

 

"pow(16x4)" VS "16 << 4"

 

So the first one, I think is doing 16x16x16x16 which gives me 65536...

 

The second one is 256...

 

 

Link to comment
https://forums.phpfreaks.com/topic/145457-left-shift-operator/#findComment-763626
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.