Modify ↓
Opened 16 years ago
Closed 16 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)
Changed 16 years ago by anonymous
comment:1 Changed 16 years ago by Jpm
- Resolution set to No Bug
- Status changed from new to closed
Guidelines for posting comments:
- You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
- In-depth discussions should take place on the forum.
For more information see the full version of the ticket guidelines here.
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