Example #1
0
        static void stringAction()
        {
            string[] str    = { "1237895", "12386597", "1238659598684" };
            string   common = StringArithmetic.longestCommonPrefix(str);

            Console.WriteLine(common);
        }
Example #2
0
        public void AddTo(int input)
        {
            string tellerAdd = StringArithmetic.Multiply(input.ToString(), this.Noemer);

            this.Teller = StringArithmetic.Add(this.Teller, tellerAdd);
            //simplify();
        }
Example #3
0
        static void Main(string[] args)
        {
            Stopwatch s = new Stopwatch();

            long[] times = new long[200];
            string vang;

            for (int j = 0; j < times.Length; j++)
            {
                s.Start();

                for (int i = 0; i < 1000; i++)
                {
                    vang = StringArithmetic.Multiply("56786573", "75435386");
                }

                s.Stop();

                times[j] = s.ElapsedMilliseconds;

                s.Reset();
            }

            long sum = times.Sum();

            Console.WriteLine((double)sum / (double)times.Length);

            //Console.WriteLine(StringArithmetic.Multiply("56786573", "75435386"));
        }
Example #4
0
        private static bool pellCheck(string x, string y, string d)
        {
            string xSquared = StringArithmetic.Multiply(x, x);

            string dTimesYSquaredPlusOne = StringArithmetic.Multiply(y, y);

            dTimesYSquaredPlusOne = StringArithmetic.Multiply(dTimesYSquaredPlusOne, d);
            dTimesYSquaredPlusOne = StringArithmetic.Add(dTimesYSquaredPlusOne, "1");

            return(xSquared == dTimesYSquaredPlusOne);
        }
Example #5
0
        public void AddInteger(int term)
        {
            string tellerAdd = StringArithmetic.Multiply(term.ToString(), Noemer);

            Teller = StringArithmetic.Add(Teller, tellerAdd);
        }