AutoHotkey Community

It is currently May 27th, 2012, 6:42 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Floor divide bug
PostPosted: August 3rd, 2011, 4:27 am 
Offline

Joined: December 13th, 2006, 7:10 am
Posts: 118
Try this:

Code:
a := 5 // -3
msgbox %a%
a := 5 // -3.0
msgbox %a%


[Moderator's note: Moved topic from Bug Reports to Ask for Help.]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 3rd, 2011, 4:29 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
Not a bug.
Quote:
The double-slash operator uses high-performance integer division if the two inputs are integers. [...] If either of the inputs is in floating point format, floating point division is performed and the result is truncated to the nearest integer to the left.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 3rd, 2011, 5:45 am 
Offline

Joined: December 13th, 2006, 7:10 am
Posts: 118
OK, sorry.
I didn't understood all the issues.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 3rd, 2011, 6:41 am 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6073
Location: San Diego, California
Smurth wrote:
OK, sorry.
I didn't understood all the issues.


If you aren't familiar with a command, function, operator, whatever.
Start by reading the documentation.
The combination of numbers you posted when reporting a 'bug' are the same values used in the documentation.

See the documentation for // here
http://www.autohotkey.com/docs/Variables.htm#Operators

if you don't understand what 'floor' is, see the defintion here
http://www.autohotkey.com/docs/Functions.htm#BuiltIn


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: batto, Bing [Bot], JSLover, sjc1000 and 64 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group