public void CoercesTypes() { object x = (int)1; object y = (double)2; NumberUtils.CoerceTypes(ref x, ref y); Assert.AreEqual(typeof(double), x.GetType()); }
private static bool CoerceTypes(ref object left, ref object right) { if (NumberUtils.IsNumber(left) && NumberUtils.IsNumber(right)) { NumberUtils.CoerceTypes(ref right, ref left); return(true); } return(false); }