yes it does... notice \ rather than /
( \ returns an integer only, which is what we want )
so:
5.2-(4.6*(5.2\4.6))
=> 5.2-(4.6*(1))
=> 5.2-(4.6)
=> 0.6 (usual floating point problem gives the extra dp's)
How does your alternative work if the numbers A and B are unknown and you want to find if A is and exact multiple of B?
if you mean the equivalent of:
If (A MOD B = 0) Then ...
that is:
If (A-(B*(A\B)) = 0) Then ...
this Mod in a function:
VB Code:
Function MyMod(NumberA, NumberB)
MyMod = NumberA-(NumberB*(NumberA\NumberB))
End Function
'usage:
If MyMod(A,B) = 0 Then ...
admittedly you'll want to cut off the extra decimal places, but you get the idea