Opened 12 years ago

Closed 11 years ago

#2152 closed Bug (Fixed)

X^2 Not Working in Hex()

Reported by: tobgle@… Owned by: Jon
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Hex Cc:


In This returns 000000, but it should return FFFFFF
Hex(255*2562+255*256+255, 6)

Attachments (0)

Change History (6)

comment:1 Changed 12 years ago by Valik

And thus trancexx learns about the law of unintended consequences.

The problem is the math you are performing is done as floating point and Hex() now returns the hex representation of a floating point number which is not the same as the hex representation of an integer in cases where you are dealing with a whole floating point number.

This is technically not a bug but it is certainly not expected by the general user, either.

Last edited 12 years ago by Valik (previous) (diff)

comment:2 Changed 12 years ago by trancexx

It was expected that some users will have problems with changed behavior of Hex() function.

The main problem here is not the Hex() function, it's the math. Integer times integer is still integer, but integer to (integer) exponent is automatically changed in type. Arguing that behavior is more correct than arguing Hex()'s.

comment:3 Changed 12 years ago by Valik

While I do not disagree that the problem is in places other than Hex() I do not find it very fair to leave the burden on users to find and report all the places we have broken their scripts in completely unexpected ways. We need to either adjust Hex()'s behavior so old scripts still work or somebody (not me) needs to go through the code very thoroughly and ensure conversions to Double only happen when it really needs to happen.

comment:4 Changed 11 years ago by Jon

  • Resolution set to Rejected
  • Status changed from new to closed

comment:5 Changed 11 years ago by Jpm

  • Resolution Rejected deleted
  • Status changed from closed to reopened

In fact integerinteger should return an integer

comment:6 Changed 11 years ago by Jon

  • Milestone set to
  • Owner set to Jon
  • Resolution set to Fixed
  • Status changed from reopened to closed

Fixed by revision [8993] in version:

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

as closed The owner will remain Jon.

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

Note: See TracTickets for help on using tickets.