Modify

Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#1332 closed Bug (Fixed)

Mod funktion wrong output

Reported by: Nike Owned by: Valik
Milestone: 3.3.1.7 Component: AutoIt
Version: 3.3.0.0 Severity: None
Keywords: Cc:

Description

mod("175367809538821201","1767842701") returns 421042353 but its wrong in real its 421042338
why autoit says its 421042353 ?? funny mathematic bug oO

Attachments (0)

Change History (8)

comment:1 by jchd, 16 years ago

Could it be a sign that Mod() in doing a floating-point computation instead of integral? Sounds like a 56-bit mantissa representation limitation.

Mod(175367809538821167, 1767842701) = 421042289
Mod(175367809538821168, 1767842701) = 421042321
Mod(175367809538821169, 1767842701) = 421042321
...
Mod(175367809538821200, 1767842701) = 421042321
Mod(175367809538821201, 1767842701) = 421042353
Mod(175367809538821202, 1767842701) = 421042353

comment:2 by Valik, 16 years ago

Yes, the problem is because the operation is being performed as floating point.

in reply to:  2 comment:3 by anonymous, 16 years ago

Replying to Valik:

Yes, the problem is because the operation is being performed as floating point.

Do you think it can get changed anytime soon or will it be part of a deeper rework to be expected significantly later?

A workaround can be to code a small dll for 64-bit bitwise ops, Mod() and possibly other functions. Is it worth doing it, since it's very easy?

comment:4 by Valik, 16 years ago

I have changes made to do it as an int first and fall back onto floating point but I'm not sure at this time if that will be changed in the next release, at a later time or ever.

in reply to:  4 comment:5 by anonymous, 16 years ago

Replying to Valik:
OK.
Last thing: are there other _basic_ core function besides bitwise ops and Mod() having a 32-bit int or floating-point limitation right now, that could benefit of a 64-bit int add-on?

comment:6 by Valik, 16 years ago

I don't know that an add-on would really help the situation. Its kind of something that needs fixed internally and its something that we need to do as soon as possible.

comment:7 by Valik, 16 years ago

Milestone: 3.3.1.7
Owner: set to Valik
Resolution: Fixed
Status: newclosed

Fixed by revision [5432] in version: 3.3.1.7

comment:8 by Valik, 16 years ago

This ticket is referenced in revision: [5433]

Modify Ticket

Action
as closed The owner will remain Valik.

Add Comment


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