gold number sequence
authorLaurent Mazet <mazet@softndesign.org>
Fri, 27 Jan 2023 06:39:23 +0000 (07:39 +0100)
committerLaurent Mazet <mazet@softndesign.org>
Fri, 27 Jan 2023 06:39:23 +0000 (07:39 +0100)
calc.c

diff --git a/calc.c b/calc.c
index 8081c804963290490c166fef5eb5cf1d1ef2425c..771f7f09657d513877c3846d4368edb2ffe086b9 100644 (file)
--- a/calc.c
+++ b/calc.c
@@ -339,6 +339,9 @@ int main (int argc, char *argv[])
 // test: echo -e '{sto (1, 0), sto (10, 0), while (inc (10) < 100, {sto (1, rcl (1) + rcl (10)), print (rcl (1))})}' | calc.exe | grep -q '=> 5050'
 
 // Fibonacci sequence
-// test: echo -e '{sto (1, 1), sto (2, 1), sto (10, 1), while (inc (10) < 12 - 1, {sto (3, rcl (1) + rcl (2)), sto (1, rcl (2)), print (sto (2, rcl (3)))})}' | calc.exe | grep '=> 144'
+// test: echo -e '{sto (1, 1), sto (2, 1), sto (10, 1), while (inc (10) < 12 - 1, {sto (3, rcl (1) + rcl (2)), sto (1, rcl (2)), print (sto (2, rcl (3)))})}' | calc.exe | grep -q '=> 144'
+
+// Gold number
+// test: echo -e '{sto (1, 1), sto (2, 1), sto (10, 1), while (inc (10) < 15 - 1, {sto (3, rcl (1) + rcl (2)), sto (1, rcl (2)), print (sto (2, rcl (3)) / rcl (1))})}' | calc.exe | grep -q '=> 1.61803'
 
 /* vim: set ts=4 sw=4 et: */