fspafford Posted February 3, 2009 Share Posted February 3, 2009 I am having problems with the Bit*** functions because they work with signed integers and I need to work with unsigned integers. Is there a recommended workaround for this problem? Frank Link to comment Share on other sites More sharing options...
weaponx Posted February 3, 2009 Share Posted February 3, 2009 Can you give me an example of expected versus actual result? Link to comment Share on other sites More sharing options...
TerarinK Posted February 3, 2009 Share Posted February 3, 2009 Because a signed value to a integer run from -2,147,483,648 to 2,147,483,647 in a 32 bit system and unsigned value run from 0 to 4,294,967,295 in a 32 bit system. There a multiple way to add on to bit, I would search "Inifinite Bits" in a search engine to get your information as it would be just as easy to inplement them in here 0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E Link to comment Share on other sites More sharing options...
PsaltyDS Posted February 3, 2009 Share Posted February 3, 2009 I am having problems with the Bit*** functions because they work with signed integers and I need to work with unsigned integers. Is there a recommended workaround for this problem? "Signed" and "unsigned" do not mean anything to the Bit* functions. It only changes the way they are displayed in decimal. As long as you are doing either bit operations with Bit* (or maybe some Binary*) functions, and not mixing that with math or String* operations, you will be fine: $binVar = 0x7FFFFFFF ConsoleWrite("$binVar = " & $binVar & @LF) ConsoleWrite("Hex = " & "0x" & Hex($binVar, 8) & @LF) $binVar = BitOR(0x80000000, $binVar) ConsoleWrite("$binVar = " & $binVar & @LF) ConsoleWrite("Hex = " & "0x" & Hex($binVar, 8) & @LF) $binVar = BitAND(0xF0F0F0F0, $binVar) ConsoleWrite("$binVar = " & $binVar & @LF) ConsoleWrite("Hex = " & "0x" & Hex($binVar, 8) & @LF) $binVar = BitXOR(0xFFFFFFFF, $binVar) ConsoleWrite("$binVar = " & $binVar & @LF) ConsoleWrite("Hex = " & "0x" & Hex($binVar, 8) & @LF) Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Richard Robertson Posted February 3, 2009 Share Posted February 3, 2009 (edited) Is the problem perhaps that AutoIt uses an internal 64 bit integer? Most people try to operate on the 32 bit boundary and only expect it to run those 32. Edited February 3, 2009 by Richard Robertson Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now