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

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

                 ? shr(8,1)          && prints 4
                 ? shr(8,2)          && prints 2
                 ? shr(15,3)         && prints 1
                 ? shr(245,8)        && prints 0

  Note:     Shr()'ing one value with another will shift the bits
            in <int> to the right the number of times specified
            by <number>. If bit 0 is 1, then that bit drops off
            the end. eg:

                 parameter = binary       = dec
                 v1        = 00000110     = 6
                 v2        = 00000010     = 2
                 shr(v1,v2)= 00000001     = 1

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


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

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