Modify ↓
Opened 17 years ago
Closed 17 years ago
#1008 closed Bug (No Bug)
Math function mod( ) result display bug
| Reported by: | txj | Owned by: | |
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | 3.3.0.0 | Severity: | None |
| Keywords: | mod | Cc: |
Description
code like this
MsgBox(0, "result", mod(-3, -1))
display is -0 , it is incorrect, it must be displayed as 0 .
I hope this bug changed in the next version(3.3.1.0) of AutoIt.
my operating system is Simplified Chinese Windows 2000 advanced server + SP4 + Rollup1 + many hotfixes.
Attachments (1)
Change History (2)
by , 17 years ago
| Attachment: | ResultOfMod.jpg added |
|---|
comment:1 by , 17 years ago
| Resolution: | → No Bug |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.

as this function can work on floating number the computation is done in float so the result is in float too.
The mod function always return a nulber with the same sign as the divisor.
That the reason you get a -0 due to the precision display.
I understand that can be a little confusing when using integers just use int(mod(x,y)) if you use only integers