Modify

Opened 15 years ago

Closed 15 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)

ResultOfMod.jpg (4.1 KB) - added by anonymous 15 years ago.

Download all attachments as: .zip

Change History (2)

Changed 15 years ago by anonymous

comment:1 Changed 15 years ago by Jpm

  • Resolution set to No Bug
  • Status changed from new to closed

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

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.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.