X-Git-Url: https://secure.softndesign.org/git/?a=blobdiff_plain;f=calc.c;h=771f7f09657d513877c3846d4368edb2ffe086b9;hb=e8a5b616d4d29941e1fef073831482bf2d85f96c;hp=8081c804963290490c166fef5eb5cf1d1ef2425c;hpb=715580ff81a00316fb8033d4ca2ceae4a2cafd94;p=calc.git diff --git a/calc.c b/calc.c index 8081c80..771f7f0 100644 --- 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: */