Visual Basic question: When I input 3\2 which is 1.5, it rounds to 1. Now, I know the difference between using \, /, and Mod. I just want to know why it rounds to 1 instead of 2.
Hmm, Visual Basic usually uses Banker Rounding which means that it always rounds to an even number. This on the other hand is not doing that. Are you using the Round function?
"Integer division is carried out using the \ Operator (Visual Basic). Integer division returns the quotient, that is, the integer that represents the number of times the divisor can divide into the dividend without consideration of any remainder." That should tell you why. It does not do rounding. It just gives you the most amount of times B can go into A, given A\B. 29\10 = 2. http://msdn.microsoft.com/en-us/library/b6ex274z.aspx
Join our real-time social learning platform and learn together with your friends!