Skip to main content

Timeline for Find the closest Fibonacci Number

Current License: CC BY-SA 3.0

7 events
when toggle format what by license comment
Jun 17, 2020 at 9:04 history edited CommunityBot
Commonmark migration
Jul 20, 2017 at 10:04 comment added sTertooy @PM2Ring You're right, I made a stupid mistake... I now have a correct solution, but with a lot more bytes. As for the lambda, I believe you're wrong. I believe the answers assigning lambda only do so because they use recursion. The other Python 3 answers doesn't assign the first lambda, for example.
Jul 20, 2017 at 10:02 history edited sTertooy CC BY-SA 3.0
added 695 characters in body
Jul 20, 2017 at 8:39 comment added PM 2Ring To fairly calculate the byte count of your code I think you need to assign the lambda, as shown in the other Python answers. However, this algorithm doesn't always work correctly for n in range(1, 1+10**8). Eg, n=70 returns 89, but it should return 55. Here are the n values < 120 that it gives wrong answers for: (27, 44, 70, 71, 114, 115, 116). For testing purposes, you may like to use the nearest_fib_PM2R function I linked in my comment on the question.
Jul 19, 2017 at 19:20 comment added musicman523 Nice job! Welcome to PPCG :)
Jul 19, 2017 at 18:30 review First posts
Jul 19, 2017 at 18:35
Jul 19, 2017 at 18:27 history answered sTertooy CC BY-SA 3.0