Modify

Opened 14 years ago

Closed 12 years ago

#2152 closed Bug (Fixed)

X^2 Not Working in Hex()

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

Description

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

Attachments (0)

Change History (6)

comment:1 by Valik, 14 years ago

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 14 years ago by Valik (previous) (diff)

comment:2 by trancexx, 14 years ago

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 by Valik, 14 years ago

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 by Jon, 13 years ago

Resolution: Rejected
Status: newclosed

comment:5 by J-Paul Mesnage, 12 years ago

Resolution: Rejected
Status: closedreopened

In fact integerinteger should return an integer

comment:6 by Jon, 12 years ago

Milestone: 3.3.9.21
Owner: set to Jon
Resolution: Fixed
Status: reopenedclosed

Fixed by revision [8993] in version: 3.3.9.21

Modify Ticket

Action
as closed The owner will remain Jon.

Add Comment


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