Trying to call the procedure cycles()
from within my function fibI, but the error is:
An object reference is required for the non-static field, method, or property array_calculator.Fibonacci_panel.cycles()'
Heres the procedure
public void cycles()
{
k++;
}
and the function
public static double fibI(double input, int k)
{
if (input == 1 || input == 2)
{
return 1;
}
else
{
double fib1 = 0;
double fib2 = 1;
double fibResult = 0;
for(double i = 1; i < input; i++ )
{
fibResult = fib1 + fib2;
fib1 = fib2;
fib2 = fibResult;
cycles();
}
return fibResult; ;
}