public ulong RunFibonachiTest([PexAssumeUnderTest] Fibonachi target, int fibo) { ulong result = target.RunFibonachi(fibo); return(result); // TODO: add assertions to method FibonachiTest.RunFibonachiTest(Fibonachi, Int32) }
public static void FibonachiFactorialExample() { const int number = 7; // factorial Console.WriteLine($"{number}! = {GetFactorial.Factorial(number)}"); Console.WriteLine("|************************************************************************|"); // fibonachi 3 for (int i = 0; i <= number; i++) { Console.WriteLine($"{ Fibonachi.FibonachiThree(i)}"); } Console.WriteLine($"Fibonachi of {number} = {Fibonachi.FibonachiThree(number)}"); Console.WriteLine("|************************************************************************|"); // fibonachi 2 for (int i = 0; i <= number; i++) { Console.WriteLine($"{ Fibonachi.FibonachiTwo(i)}"); } Console.WriteLine($"Fibonachi of {number} = {Fibonachi.FibonachiTwo(number)}"); Console.WriteLine("|************************************************************************|"); }
public void FibonachiComputeTest() { Fibonachi fc = new Fibonachi(); Assert.IsTrue(fc.Compute(1) == 1); Assert.IsTrue(fc.Compute(5) == 5); Assert.IsTrue(fc.Compute(10) == 55); }
private void btnFibonachiToBinary_Click(object sender, EventArgs e) { int fibResolution = Convert.ToInt32(txtFibonachiRes.Text); double fibRange = Fibonachi.CalculateFibonachiRange(fibResolution); txtBinaryRes.Text = ((int)Math.Log(fibRange, 2)).ToString(); }
double GetIdeal(int i) { if (alpha != -1.0) { return(Math.Pow(alpha, i)); } else { return(Fibonachi.GetNFibonachi(i)); } }
public void RunFibonachiTest698() { Fibonachi fibonachi; ulong l; object boxl = (object)(default(ulong)); fibonachi = new Fibonachi(); fibonachi.RunThreadedFibonachi(boxl); l = this.RunFibonachiTest(fibonachi, 2); Assert.AreEqual <ulong>(1uL, l); Assert.IsNotNull((object)fibonachi); Assert.AreEqual <ulong>(0uL, fibonachi.Fibonum); }
static void Main(string[] args) { Fibonachi fibonachiNumber = NumberGenerate; Console.WriteLine(fibonachiNumber()); Console.WriteLine(fibonachiNumber()); Console.WriteLine(fibonachiNumber()); Console.WriteLine(fibonachiNumber()); Console.WriteLine(fibonachiNumber()); Console.WriteLine(fibonachiNumber()); Console.ReadKey(); }
public void RunFibonachiTest368() { Fibonachi fibonachi; ulong l; object boxl = (object)(default(ulong)); PexSafeHelpers.AssignBoxedValue <ulong>(boxl, 1uL); fibonachi = new Fibonachi(); fibonachi.RunThreadedFibonachi(boxl); l = this.RunFibonachiTest(fibonachi, 4); Assert.AreEqual <ulong>(3uL, l); Assert.IsNotNull((object)fibonachi); Assert.AreEqual <ulong>(1uL, fibonachi.Fibonum); }
static void Main(string[] args) { HalfDivision half = new HalfDivision(0.6, 3.6, 0.01, "max"); half.Calculate(); Dihotomii diho = new Dihotomii(0.6, 3.6, 0.01, "max"); diho.Calculate(); GoldCut goldCut = new GoldCut(0.6, 3.6, 0.01, "max"); goldCut.Calculate(); Fibonachi fibon = new Fibonachi(0.6, 3.6, 0.01, "max"); fibon.Calculate(); Console.Read(); }
public void Generate_Fib() { BigInteger[][] expected = { new BigInteger[] { 0 }, new BigInteger[] {0, 1 }, new BigInteger[] {0, 1, 1 }, new BigInteger[] {0, 1, 1, 2 }, new BigInteger[] {0, 1, 1, 2, 3 }, new BigInteger[] {0, 1, 1, 2, 3, 5 }, new BigInteger[] {0, 1, 1, 2, 3, 5, 8 }, new BigInteger[] { 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711 } }; int[] inputLengthes = new int[] { 1, 2, 3, 4, 5, 6, 7, 23 }; for (int i = 0; i < inputLengthes.Length; i++) { CollectionAssert.AreEqual(expected[i], Fibonachi.GenerateFibonachi(inputLengthes[i])); } }
public void FibonacciGeneratorTest2() { var b = new BigInteger[] { 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946 }; CollectionAssert.AreEqual(b, Fibonachi.FibonachiNum(22)); }
public void FibonachiNumbersTst() { var b = new BigInteger[] { 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377 }; CollectionAssert.AreEqual(b, Fibonachi.FibonachiNum(15)); }
public void Generate_Fib_NotValid(int length) => Assert.Throws <ArgumentException>(() => Fibonachi.GenerateFibonachi(length));