Modify

Opened 7 months ago

Closed 2 months ago

#3703 closed Bug (Wont Fix)

2 ^ 49 and further return wrong results

Reported by: timsky Owned by:
Milestone: Component: AutoIt
Version: 3.3.14.5 Severity: None
Keywords: Cc:

Description

Bug starts at 2 49 and further. Sample code:

$iInt64 = Int(2 ^ 49, 1)
ConsoleWrite($iInt64 & @lf)
562949953421313

Attachments (0)

Change History (3)

comment:1 in reply to: ↑ description Changed 7 months ago by t

Replying to timsky:

Bug starts at 2 49 and further. Sample code:

$iInt64 = Int(2 ^ 49, 1)
ConsoleWrite($iInt64 & @lf)
562949953421313

Sorry there is a typo. Code should be:

$iInt64 = Int(2 ^ 49, 2)
ConsoleWrite($iInt64 & @lf)

comment:2 Changed 4 months ago by water

Telling us that something is wrong isn't enough.
As the wiki states: A ticket "should contain all the information necessary to reproduce the issue".
So please provide the expected (correct) result as well.

comment:3 Changed 2 months ago by Jpm

  • Resolution set to Wont Fix
  • Status changed from new to closed

Hi,
the result must Be 562949953421312
In fact the problem comes from the fact that 2 49 in a floating point which reach the max precision 15/16 digits so the conversion to integer is "rounded".
I Don't fully Understand why Int( 2
48 * 2, 2) is OK but the rounding as Something to do in the internal calculation.

You cannot expect that integer exact conversion in the range

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 closed 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.