Like this, you have options - you can round
a floating point number to an integer, if you need it, or format
an integer as floating point (I think adding 0.0
to an integer will already do this, try msgbox % 4 + 0.0
), before applying floor division
I think the floating point version is what is usually considered as floor division
while the other case is what is indeed often called integer division
(a certain type of it, at least), especially the specific kind you will encounter in some programming languages like C
, which will return only integers.
But afaik, integer division
is not clearly defined in mathematics, it is not closed
in a mathematical sense and hence, not handled unambiguously. So, consistency might not really be a relevant category here... it is rather a matter of definition.
Since AHK's source code is written in C++, it can probably make direct use of some "high performance" integer division
of the language. Perhaps some of our C++ or AHK source code gurus can chime in on this. (So far, I have succesfully suppressed my long-ago experiences with C
But in the end, it is documented like this, not really uncommon in programming and it can be handled. So I wouldn't expect it to change (which might even break a number of older scripts).