home *** CD-ROM | disk | FTP | other *** search
/ PCNET 2006 September - Disc 1 / PCNET_CD_2006_09.iso / shareware / autoit-v3-setup.exe / Examples / Helpfile / BitRotate.au3 < prev    next >
Encoding:
Text File  |  2006-06-17  |  356 b   |  9 lines

  1. $x = BitRotate(7, 2)
  2. ;  x == 3 because 111b left-rotated twice is 1 1100b == 28
  3.  
  4. $y = BitRotate(14, -2)
  5. ;  y == 32771 because 1110b right-rotated twice on 16 bits is 1000 0000 0000 0011b == 32771
  6.  
  7. $z = BitRotate(14, -2, "D")
  8. ;  z == -2147483645 because 1110b right-rotated twice on 16 bits is 1000 0000 0000 0000 0000 0000 0000 0011b == 2147483645
  9.