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>or() - bitwise or of two numbers</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Name:     or() - bitwise or of two numbers
  Usage:    or(<int>,<number>)
  Params:   integer <int> - number to or, not greater then 65535
            integer <number> number to or <int> with
  Returns:  integer equal to the bitwise or of <int> and <number>

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

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

  Note:     Oring one value with another will set on those bits
            in param 1 where the bit in position <n> of either
            param 1 or 2 is set to 1, eg:

                 parameter = binary value      = dec
                 v1        = 0000000000110101  = 53
                 v2        = 0000000010010100  = 148
                 or(v1,v2) = 0000000010110101  = 181

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


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

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