You are viewing a single comment's thread. Return to all comments →
public static string isFibo(long n) { double squareTest = (5 * Math.Pow((double)n, 2)) + 4; double sqrt = Math.Sqrt(squareTest); if(sqrt % 1 == 0) return "IsFibo"; squareTest = (5 * Math.Pow((double)n, 2)) - 4; sqrt = Math.Sqrt(squareTest); if(sqrt % 1 == 0) return "IsFibo"; return "IsNotFibo"; }
Seems like cookies are disabled on this browser, please enable them to open this website
Is Fibo
You are viewing a single comment's thread. Return to all comments →