Opened on Dec 7, 2009 at 5:43:03 PM
Closed on Dec 9, 2009 at 1:30:04 AM
Last modified on Dec 9, 2009 at 1:34:50 AM
#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)
follow-up: 3 comment:2 by , on Dec 7, 2009 at 11:29:34 PM
Yes, the problem is because the operation is being performed as floating point.
comment:3 by , 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?
follow-up: 5 comment:4 by , 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.
comment:5 by , 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 , 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 , on Dec 9, 2009 at 1:30:04 AM
| Milestone: | → 3.3.1.7 |
|---|---|
| Owner: | set to |
| Resolution: | → Fixed |
| Status: | new → closed |
Fixed by revision [5432] in version: 3.3.1.7

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