Modify

#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, on Dec 7, 2009 at 11:15:04 PM

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, on Dec 7, 2009 at 11:29:34 PM

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

in reply to:  2 comment:3 by anonymous, on Dec 8, 2009 at 2:09:12 AM

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, on Dec 8, 2009 at 2:13:00 AM

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, on Dec 8, 2009 at 2:26:15 AM

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, on Dec 8, 2009 at 3:51:33 AM

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, on Dec 9, 2009 at 1:30:04 AM

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, on Dec 9, 2009 at 1:34:50 AM

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.