Example #1
0
        /// <summary>
        /// Returns the Factoral of Number
        /// </summary>
        /// <param name="Number"></param>
        /// <returns></returns>
        public static String Factorial(String Number)
        {
            var valueNumber = new BigMathNumber();

            valueNumber.SetValue(Number);
            var answer      = BigMathHelper.Factorial(valueNumber);
            var returnValue = answer.ToString();

            return(returnValue);
        }
Example #2
0
        /// <summary>
        /// Returns the result of BaseNumber^Exponent
        /// </summary>
        /// <param name="BaseNumber"></param>
        /// <param name="Exponent"></param>
        /// <returns></returns>
        public static String Exponential(String BaseNumber, String Exponent)
        {
            var baseNumber = new BigMathNumber();
            var exponent   = new BigMathNumber();

            baseNumber.SetValue(BaseNumber);
            exponent.SetValue(Exponent);
            var answer      = BigMathHelper.Exponential(baseNumber, exponent);
            var returnValue = answer.ToString();

            return(returnValue);
        }
Example #3
0
        /// <summary>
        /// Returns quotient of Dividend / Devisor
        /// </summary>
        /// <param name="Dividend"></param>
        /// <param name="Devisor"></param>
        /// <returns></returns>
        public static String Divide(String Dividend, String Devisor)
        {
            var leftNumber  = new BigMathNumber();
            var rightNumber = new BigMathNumber();

            leftNumber.SetValue(Dividend);
            rightNumber.SetValue(Devisor);

            var answer = leftNumber / rightNumber;

            var answerResponse = answer.ToString();

            return(answerResponse);
        }
Example #4
0
        /// <summary>
        /// Returns the Product of Left * Right
        /// </summary>
        /// <param name="Left"></param>
        /// <param name="Right"></param>
        /// <returns></returns>
        public static String Multiply(String Left, String Right)
        {
            var leftNumber  = new BigMathNumber();
            var rightNumber = new BigMathNumber();

            leftNumber.SetValue(Left);
            rightNumber.SetValue(Right);

            var answer = leftNumber * rightNumber;

            var answerResponse = answer.ToString();

            return(answerResponse);
        }
Example #5
0
        internal static BigMathNumber ConvertStringToBigMathNumber(string number)
        {
            var newBigMathNumber = new BigMathNumber();

            //is the number negative?
            //is the number only a number?
            //does the number contain a decimal?
            if (IsNumeric(number))
            {
                newBigMathNumber.SetValue(number);
            }
            else
            {
                throw new System.ArgumentOutOfRangeException("Value provided is not a valid Number");
            }
            return(newBigMathNumber);
        }