Exemple #1
0
        // Ceiling, Floor?

        public static T DivRem <T>(T dividend, T divisor, out T remainder)
        {
            try
            {
                var dT = DynamicStaticTypeMembers.Create <T>();
                return(dT.DivRem(dividend, divisor, out remainder));
            }
            catch
            {
                var dT = DynamicStaticTypeMembers.Create(typeof(Math));
                return(dT.DivRem(dividend, divisor, out remainder));
            }
        }
Exemple #2
0
 public static T Abs <T>(T a)
 {
     // TODO: If T is unsigned, return a
     try
     {
         var dT = DynamicStaticTypeMembers.Create <T>();
         return(dT.Abs(a));
     }
     catch
     {
         dynamic da = a;
         return(Math.Abs(da));
     }
 }