1 Replies - 1892 Views - Last Post: 18 February 2010 - 07:06 PM

#1 m2s87   User is offline

  • D.I.C Regular
  • member icon

Reputation: 21
  • View blog
  • Posts: 390
  • Joined: 28-November 06

Fibonacci Numbers done recrusively

Posted 10 January 2007 - 10:58 AM

Description: use it like: f_numbers=fib_r(nr) you can return spetsific number like: x=split(fib_r(nr),",") fib46=x(45)An efficient recursive solution returning Fibonacci Numbers.
Function fib_r(nr#, Optional a1# = 1, Optional a2# = 0) As String
    If nr > 1 And nr < 1476 Then fib_r = fib_r(nr - 1, a1 + a2, a1) Else: If nr > 1476 Then fib_r = "viga"
    fib_r = a1 + a2 & "," & fib_r
End Function


Is This A Good Question/Topic? 0
  • +

Replies To: Fibonacci Numbers done recrusively

#2 ccyndimolina   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 16-January 10

Re: Fibonacci Numbers done recrusively

Posted 18 February 2010 - 07:06 PM

That was a great code snippet! THANK YOU!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1