Modify

Opened 3 months ago

Last modified 8 weeks ago

#3717 new Bug

StringFormat don't format int64 integers correctly

Reported by: jchd18 Owned by:
Milestone: Component: AutoIt
Version: 3.3.14.0 Severity: None
Keywords: Cc:

Description

The code below returns invalid results due to %i, %d and %u specifiers being limited to 32-bit integers.

Local $b = [["2^31-1", 2^31-1], ["2^31  ", 2^31], ["2^32-1", 2^32-1], ["2^32  ", 2^32], ["2^33  ", 2^33]], $s, $n

For $i = 0 To UBound($b) - 1
	$s = $b[$i][0]
	$n = $b[$i][1]
	ConsoleWrite(StringFormat("%-14s%-6s%12i", $s & "  [%i]", VarGetType($n), $n) & (StringFormat("%i", $n) = $n ? "" : "  should be  " & $b[$i][1]) & @LF)
	ConsoleWrite(StringFormat("%-14s%-6s%12u", $s & "  [%u]", VarGetType($n), $n) & (StringFormat("%u", $n) = $n ? "" : "  should be  " & $b[$i][1]) & @LF & @LF)
Next

Attachments (0)

Change History (1)

comment:1 Changed 8 weeks ago by water

Tested with 3.3.15.0 - same problem.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as new The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.