Example #1
0
        public void CoercesTypes()
        {
            object x = (int)1;
            object y = (double)2;

            NumberUtils.CoerceTypes(ref x, ref y);
            Assert.AreEqual(typeof(double), x.GetType());
        }
Example #2
0
 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);
 }