Modify

Opened 11 years ago

Closed 6 years ago

#3017 closed Bug (Duplicate)

The largest negative integer value we misinterpret

Reported by: anonymous Owned by:
Milestone: Component: AutoIt
Version: 3.3.13.20 Severity: None
Keywords: integer Cc:

Description

The following code illustrates the problem

ConsoleWrite("- 9223372036854775808 = (int)" & Int (-9223372036854775808) & "= (hex)" & Hex (-9223372036854775808) &CRLF)
ConsoleWrite("- 9223372036854775807-1 = (int)" & Int (-9223372036854775807 - 1) & "= (hex)" & Hex (-9223372036854775807 - 1) &CRLF)

at -9223372036854775808 I get as a result -9223372036854775807
at (-9223372036854775807 - 1) I get the correct result -9223372036854775808

tested with the last stable and beta version

Attachments (0)

Change History (7)

comment:1 by jchd18, 11 years ago

This is rather the largest negative int64 value, but yes there seems to be an issue with parsing the literal value -9223372036854775808.

comment:2 by BrewManNH, 11 years ago

That's not an Int64 value, it's too large. When converting it to a 64 bit value, -9223372036854775808 and -9223372036854775807 yield the same result.
http://www.binaryconvert.com/result_double.html?decimal=045057050050051051055050048051054056053052055055053056048056

comment:3 by anonymous, 11 years ago

Not Int with Double confused !!
http://calc.penjee.com/?s=HJJJJJJJJJJJJJJJ

comment:4 by jchd18, 11 years ago

-9223372036854775808 and -9223372036854775807 yield the same result.

Only when using a site which limits integral values to Int32 or under the double tab.

And no they are not the same value and both are valid int64 values.

comment:5 by czardas, 11 years ago

This appears to be a bug connected with string conversion. See the following topic : https://www.autoitscript.com/forum/topic/176690-number-puzzle/ It seems to occur with various functions which convert the integer to a string - including ConsoleWrite.

ConsoleWrite(-9223372036854775808 & @LF) ; -9223372036854775807

comment:6 by jchd18, 11 years ago

Summary: The smallest value of integer we misinterpretedThe largest negative integer value we misinterpret

comment:7 by J-Paul Mesnage, 6 years ago

Resolution: Duplicate
Status: newclosed

same as #3772

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.