CInt will round to the nearest even number, that is to say, when the decimal part is 0.5XXXX, it will round to the nearest even number to X.5XX, and Int is the rounding function, which will remove the decimal part.
CInt will round to the nearest even number, that is to say, when the decimal part is 0.5XXXX, it will round to the nearest even number to X.5XX.
For example, Cint(0.5)=0; Cint(1.5)=2; Cint(2.5)=2; Cint(3.5)=4
And Int is the rounding function, which will remove the decimal point. For example, Int(1.5)=1...
Such positioning is not accurate, and it is a missed test according to the test angle. The first one: the Cint function does not take into account the situation of Cint(0.51)=1, Cint(2.51)=3. Second: The Int function does not take into account the situation of negative numbers: Int(-1.1)=-2, Int(-1.5)=-2, so I summarize it as follows: Int function: round to the left on the number axis. Cint function: Rounds to an integer, regardless of positive or negative numbers. But when *.5 or -*.5, the even value is taken. But note: Cint(0.51)=1, Cint(-0.51) is also equal to -1.
Summarize:
int function: round to the left on the number axis.
Cint function: Rounds to an integer, regardless of positive or negative numbers. But when *.5 or -*.5, the even value is taken.
Cint(0.5)=0 -> 0
Cint(0.51)=1 -> 1
Cint(1.5)=2 -> 2
Cint(2.5)=2 -> 2
Cint(2.51)=3 -> 3
Cint(2.6)=3 -> 3
Cint(2.62)=3 -> 3
Cint(3.5)=4 -> 4
Cint(3.3)=3 -> 3
Cint(1.2)=1 -> 1
Int(-1.1)=-2 -> -2
Int(-1.5)=-2 -> -2