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

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

                 ? ror(8,1)          && prints 4
                 ? ror(8,2)          && prints 2
                 ? ror(15,3)         && prints 135
                 ? ror(245,8)        && prints 245

  Note:     Ror'ing one value with another will rotate the bits
            in <int> to the right the number of times specified
            by <number>. If bit 0 is 1, that bit rotates around
            to bit position 7. this is useful when reversing the
            attributes on the screen. Rotating <int> by 8 rotates
            all bits back to where they started. ror() only works
            on integer values less than 256. eg:

                 parameter = binary       = dec
                 v1        = 00000110     = 6
                 v2        = 00000010     = 2
                 ror(v1,v2)= 10000001     = 129

            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() shr()

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