Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FUNCky - <b>name:</b> <b>and() - bitwise and of two numbers</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Name:     and() - bitwise and of two numbers
  Usage:    <integer> = and(<int>,<number>)
  Params:   integer <int> - number to and, not greater then 65535
            integer <number> number to and <int> with
  Returns:  integer equal to the bitwise and of <int> and <number>

 ---------------------------------- Example ---------------------------------

                 ? and(1,0)          && prints 0
                 ? and(1,1)          && prints 1

  Note:     Anding one value with another will zero out those bits
            in param 1 where the bits in position <n> of param 1 and 2
            are not BOTH set to 1, eg:

                 parameter = binary value      = dec
                 v1        = 0000000000110101  = 53
                 v2        = 0000000010010100  = 148
                 and(v1,v2)= 0000000000010100  = 20

            You can use num2bin() and bin2num() to convert
            binary strings into their decimal equivalents for ease
            when using the binary functions.


See Also: or() xor() rol() ror() test() shl() shr()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson