Beispiel #1
0
        public static dynamic Division(dynamic a, dynamic b)
        {
            double resultA = DynamicCast.ConvertToDouble(a);
            double resultB = DynamicCast.ConvertToDouble(b);

            if (Math.Abs(resultB) < Tolerance)
            {
                return(double.PositiveInfinity);
            }

            return(resultA / resultB);
        }
Beispiel #2
0
        public static dynamic Log10(dynamic a)
        {
            double resultA = DynamicCast.ConvertToDouble(a);

            return(Math.Log10(resultA));
        }
Beispiel #3
0
        public static dynamic Negative(dynamic a)
        {
            double resultA = DynamicCast.ConvertToDouble(a);

            return(-resultA);
        }
Beispiel #4
0
        public static dynamic Pow10(dynamic a)
        {
            double resultA = DynamicCast.ConvertToDouble(a);

            return(Math.Pow(10.0, resultA));
        }
Beispiel #5
0
        public static dynamic Sqrt(dynamic a)
        {
            double resultA = DynamicCast.ConvertToDouble(a);

            return(Math.Sqrt(resultA));
        }
Beispiel #6
0
        public static dynamic Round(dynamic a)
        {
            double resultA = DynamicCast.ConvertToDouble(a);

            return(Math.Round(resultA));
        }
Beispiel #7
0
        public static bool IsNegative(dynamic a)
        {
            double resultA = DynamicCast.ConvertToDouble(a);

            return(resultA < 0);
        }
Beispiel #8
0
        public static bool IsWhole(dynamic a)
        {
            double resultA = DynamicCast.ConvertToDouble(a);

            return(Math.Abs(resultA % 1) < Tolerance);
        }
Beispiel #9
0
        public static dynamic Atan(dynamic a)
        {
            double resultA = DynamicCast.ConvertToDouble(a);

            return(Math.Atan(resultA) / Math.PI * 180);
        }
Beispiel #10
0
        public static dynamic Tan(dynamic a)
        {
            double resultA = DynamicCast.ConvertToDouble(a);

            return(Math.Tan(resultA / 180 * Math.PI));
        }