SpatialReference sr = SpatialReferences.WebMercator; // precision = 1 / MScale = 0.0001
// MapPoint
MapPointBuilderEx pointBuilder = new MapPointBuilderEx(3, 4, sr);
pointBuilder.M = 5.00006;
MapPoint point = pointBuilder.ToGeometry();
MapPoint outputPoint = GeometryEngine.Instance.SnapMsToSpatialReference(point) as MapPoint;
// outputPoint.M = 5.0001
// Multipoint
pointBuilder = new MapPointBuilderEx(-3, -4, sr);
pointBuilder.M = -5.000007;
MapPoint point2 = pointBuilder.ToGeometry();
Multipoint multipoint = MultipointBuilderEx.CreateMultipoint(new MapPoint[] { point, point2 }, AttributeFlags.HasM, sr);
Multipoint outputMultipoint = GeometryEngine.Instance.SnapMsToSpatialReference(multipoint) as Multipoint;
// outputMultipoint.Points[0].M = 5.0001, outputMultipoint.Points[1].M = -5
// Polyline
string json = "{\"hasM\":true,\"paths\":[[[3,2,10.00065],[3,4,15.000325],[5,4,20],[5,2,15.000325],[3,2,10.00065]]],\"spatialReference\":{\"wkid\":3857}}";
Polyline polyline = PolylineBuilderEx.FromJson(json);
Polyline outputPolyline = GeometryEngine.Instance.SnapMsToSpatialReference(polyline) as Polyline;
// The M-values for the vertices in outputPolyline are { 10.0007, 15.0003, 20, 15.0003, 10.0007 }