static void stringAction() { string[] str = { "1237895", "12386597", "1238659598684" }; string common = StringArithmetic.longestCommonPrefix(str); Console.WriteLine(common); }
public void AddTo(int input) { string tellerAdd = StringArithmetic.Multiply(input.ToString(), this.Noemer); this.Teller = StringArithmetic.Add(this.Teller, tellerAdd); //simplify(); }
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")); }
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); }
public void AddInteger(int term) { string tellerAdd = StringArithmetic.Multiply(term.ToString(), Noemer); Teller = StringArithmetic.Add(Teller, tellerAdd); }