-4/3 = -1.333333
Floor(-1.333333) = -2
Why would something 'high-performance' give you the wrong answer?
It is the wrong answer
for you because you are asking the wrong question.
High-performance integer division is just integer division, using the native CPU instruction for such. Floating-point division is slower, as with floating-point in general, hence calling integer division high-performance. As I understand it, integer division truncates (or simply does not compute) the fractional part. It does not round, floor or ceiling.
Unfortunately,
// truly performs two different operations: "floor division" if either input is floating-point and "integer division" if both are integers.
The following all return true on v2:
Code: Select all
MsgBox Integer(-4/3) = -4//3
MsgBox Integer(+4/3) = +4//3
MsgBox Integer(-5/3) = -4//3
MsgBox Integer(+5/3) = +4//3
Replacing Integer with any other single function will not give the same results.