comp.lang.ada
 help / color / mirror / Atom feed
From: firth@sei.cmu.edu (Robert Firth)
Subject: Re: Fibonacci Numbers?
Date: Mon, 19 Sep 1994 07:57:20 EDT
Date: 1994-09-19T07:57:20-04:00	[thread overview]
Message-ID: <1994Sep19.075720.22683@sei.cmu.edu> (raw)
In-Reply-To: 35fl28$1h3@garuda.csulb.edu

In article <35fl28$1h3@garuda.csulb.edu> zoltan@csulb.edu (S. Hegede) writes:

>Hey!  I'm an a beginning Ada programmer and I've been stuck for a while
>on trying to write a program in which a user can get the number in a
>Fibonacci series( Ex.  1,1,2,3,5,8,13,21...) by typing its position in
>the series.  I only need help on getting the formula down that would
>calculate the next number in the series.  Thanks for the help.

F0 = 0; F1 = 1; Fn = Fn-1 + Fn-2

There's also a closed form, but since it involves exponentiation
of real numbers it's probably faster to compute via the recurrence
formula.



  parent reply	other threads:[~1994-09-19 11:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-09-17 20:54 Fibonacci Numbers? S. Hegede
1994-09-18  5:17 ` Weiqi Gao
1994-09-19 14:16   ` Robert I. Eachus
1994-09-20  2:47   ` Philip Brashear
1994-09-19 11:57 ` Robert Firth [this message]
1994-09-20  2:15 ` Keith Thompson @pulsar
1994-09-20 16:25   ` Robert Dewar
1994-09-21  0:57     ` David Weller
1994-09-23 16:33     ` Joseph Skinner
1994-09-23 20:55     ` Jeffrey J. Hallman
1994-09-20  6:36 ` pk
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox