Code: Select all
msgbox, % ~~-1 ;-1 is 0xFFFFFFFFFFFFFFFF. ~ that is 0x00000000. ~ that is 0xFFFFFFFF
;workaround:
; x := -1
; is64Bit := x < 0 OR x > 0xFFFFFFFF
; y := ~~x
; if(is64Bit AND y >= 0 AND y <= 0xFFFFFFFF)
; {
; y |= 0x7FFFFFFF00000000
; y := y << 1 >> 1 ;the negative bit is special for some reason
; }
; msgbox, % y