File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
projects/find-nth-fibonacci/src Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 1- // use std::{}
1+ /*
2+ * We just follow this formula that gives us the nth number of the Fibonacci sequence
3+ * F(n) = (φ^n - (1-φ)^n) / √5
4+ * This function uses the `Golden Ratio` (φ), which is approximately equal to 1.618033988749895
5+ * The Golden Ratio is an irrational number that has unique properties, making it a fundamental element of mathematics and science
6+ * In the context of the Fibonacci sequence, the Golden Ratio is used to calculate the nth number in the sequence
7+ */
28
39// ============================================================================
410
5- const GOLDEN_RATIO : f64 = 1.618033988749895 ; // known as φ (phi)
11+ const GOLDEN_RATIO : f64 = 1.618033988749895 ; // known as φ (phi), the Golden Ratio
612
713fn main ( ) {
814 // just clear the console for us
You can’t perform that action at this time.
0 commit comments