I think : ClosetVertexTo is not equal to ClosetPointTo
Correct, the ClosestVertex will not always be the ClosestPoint, however, the methods implemented by gile and I are correct since there are effectively four cases to consider:
1) Trivial Case in which the vertex is the closest point, i.e. the Parameter of the Closest Point is an Integer and no rounding occurs.
2) The Closest Point lies above the midpoint of the Polyline Segment, and hence the Parameter at that point is greater than a half and will be rounded up (Polyline Segment shown in Green, Arbitrary Point shown in Cyan):
3) The Closest Point lies below the midpoint of the Polyline Segment, and hence the Parameter at that point is less than a half and will be rounded down:
4) The Closest Point lies on the midpoint of the Polyline Segment, and hence the Parameter at that point is equal to a half and, by rounding convention, will be rounded up: