Skip to content

Instantly share code, notes, and snippets.

@raphaelm
Created July 1, 2010 19:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save raphaelm/460421 to your computer and use it in GitHub Desktop.
Save raphaelm/460421 to your computer and use it in GitHub Desktop.
Fibonacci for lutoma's performance comparisons - in object free pascal
program unbenannt;
{$mode objfpc}{$H+}
uses sysutils;
var i, nums: integer;
var a, b, now: real;
BEGIN
a := 0;
b := 1;
now := 0;
if ParamCount = 1 then begin
nums := strtoint(ParamStr(1));
for i:=0 to nums do begin
now := a+b;
b := a;
a := now;
writeln(floattostr(a))
end;
end else begin
writeln('USAGE '+ParamStr(0)+' [amout of numbers to be generated]');
exit;
end;
END.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment