﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
3980	Hexadecimal notation in the range 0x80000000 to 0xFFFFFFFFFF	AspirinJunkie		"In AutoIt, numerical values in the source code can be defined in decimal notation as well as in hexadecimal notation.
In the number range 0x80000000 to 0xFFFFFFFFFF, however, the inputs are not interpreted as hexadecimal numbers but as a binary, which is coded as an Int32 number and therefore becomes a negative number.

A distinction must be made here between the number representation in hexadecimal notation, which should still be independent of the subsequent coding when defined in the source code, and the binary coding in specific data types, which only takes place later.

So if a user writes 0x90000001 in the source code, he expects to have written the decimal number 2415919105 ([[https://www.numberplanet.com/number/90000001/index.html|see here]]). Instead, he receive the number -1879048191.

One solution would therefore be to always save hexadecimal values greater than 0x80000000 as Int64.

Example for clarification:


{{{
#!autoit
; interpreted as 32 Bit-Int
Global $a = 0x7FFFFFFF
Global $b = 0x80000000

ConsoleWrite(""$a: "" & $a & "" ("" & VarGetType($a) & "")"" & @CRLF)
ConsoleWrite(""$b: "" & $b & "" ("" & VarGetType($b) & "")"" & @CRLF)


; interpreted as 64 Bit-Int
Global $a = 0x07FFFFFFF
Global $b = 0x080000000

ConsoleWrite(""$a: "" & $a & "" ("" & VarGetType($a) & "")"" & @CRLF)
ConsoleWrite(""$b: "" & $b & "" ("" & VarGetType($b) & "")"" & @CRLF)
}}}
"	Bug	closed		AutoIt	3.3.16.1	None	Rejected		
