AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVE] Bits (https://forums.alliedmods.net/showthread.php?t=254286)

Process 01-01-2015 05:33

[SOLVE] Bits
 
Can someone explain what does this take as a value

( 1 << 4 ) | ( 1 << 5 )

and what is it !

RateX 01-01-2015 06:00

Re: Bits
 
https://forums.alliedmods.net/showthread.php?t=139916

Process 01-01-2015 06:21

Re: Bits
 
did i told you to give me a link of a TUT ? i've already read it but i didn't understand the last part

klippy 01-01-2015 07:14

Re: Bits
 
"what does this take as a value" can you explain that better?
But all you need is to understand bit-wise operators to understand that bit of code.

jimaway 01-01-2015 07:38

Re: Bits
 
( 1 << 4 ) | ( 1 << 5 ) will result with a binary value of 11 0000
if you use that (the bit shifting part) in your code as an integer, the decimal value will be used ( 48 )

Freezo Begin 01-01-2015 09:28

Re: Bits
 
Try this calculator

http://ostermiller.org/calc/calculator.html

let me explain little bit

1 << 4 = 2^4 = 16
1 << 5 = 2^5 = 32

as a 11 000

so 16 | 32 = 48

Process 01-01-2015 10:07

Re: Bits
 
Thanks all , now i understand better :) .


All times are GMT -4. The time now is 15:25.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.