c# Programming Glossary: fib
Generate tail call opcode http://stackoverflow.com/questions/15864670/generate-tail-call-opcode with what C# did. My F# example looks like this let rec fibb i acc if i 0 then acc else fibb i 1 acc i Console.WriteLine.. looks like this let rec fibb i acc if i 0 then acc else fibb i 1 acc i Console.WriteLine fibb 3 0 And the generated IL for.. acc if i 0 then acc else fibb i 1 acc i Console.WriteLine fibb 3 0 And the generated IL for the fib method looks like this..
Refactoring Fibonacci Algorithm http://stackoverflow.com/questions/406446/refactoring-fibonacci-algorithm static void Main string args Console.WriteLine Find all fibinacci numbers between int from Convert.ToInt32 Console.ReadLine.. And int to Convert.ToInt32 Console.ReadLine Fibonacci fibonacci new Fibonacci fibonacci.PrintArrayList fibonacci.Between.. Console.ReadLine Fibonacci fibonacci new Fibonacci fibonacci.PrintArrayList fibonacci.Between from to class Fibonacci..
Questions on a Haskell -> C# conversion http://stackoverflow.com/questions/6082640/questions-on-a-haskell-c-sharp-conversion out on paper remaining instance methods are not needed fib n divide twoPhi^n 2 twoPhi ^n where twoPhi Ext 1 1 divide Ext.. Integer with Rational in the original code you can write fib n even closer to Binet's formula fib n divSq5 phi^n 1 phi ^n.. code you can write fib n even closer to Binet's formula fib n divSq5 phi^n 1 phi ^n where divSq5 Ext 0 b numerator b phi..
Generate tail call opcode http://stackoverflow.com/questions/15864670/generate-tail-call-opcode I was trying to generate a tail call opcode using C#. Fibinacci is an easy one so my c# example looks like this private.. private static void Main string args Console.WriteLine Fib int.MaxValue 0 public static int Fib int i int acc if i 0 .. Console.WriteLine Fib int.MaxValue 0 public static int Fib int i int acc if i 0 return acc return Fib i 1 acc i If I..
|