Beispiel #1
0
        public static BigMathNumber operator *(BigMathNumber left, BigMathNumber right)
        {
            BigMathNumber answer = new BigMathNumber();

            answer = BigMathHelper.Multiply(left, right);
            return(answer);
        }
Beispiel #2
0
        public static BigMathNumber operator -(BigMathNumber left, BigMathNumber right)
        {
            BigMathNumber answer = new BigMathNumber();

            answer = BigMathHelper.Subtract(left, right);
            return(answer);
        }
Beispiel #3
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);
        }
Beispiel #4
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);
        }
Beispiel #5
0
        private List <sbyte> ConvertToList(string value)
        {
            if (!BigMathHelper.IsNumeric(value))
            {
                throw new ArgumentOutOfRangeException("Value provided is not a valid number.");
            }
            List <sbyte> newNumber = new List <sbyte>();

            for (int i = value.Length - 1; i >= 0; i--)
            {
                newNumber.Add(Convert.ToSByte(value.Substring(i, 1)));
            }
            return(newNumber);
        }