repo.or.cz
/
sunny256-utils.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
test-ly-files: Display symlink creation, add `-v` to `ln`
[sunny256-utils.git]
/
fibonacci
blob
91850b65700d97cbd3050d771d891834891fc2f5
1
#!/usr/bin/env perl
2
3
#=======================================================================
4
# fibonacci
5
# File ID: ad60b6b4-5d39-11df-9c8b-90e6ba3022ac
6
# Skriver ut Fibonacci-rekka.
7
#=======================================================================
8
9
use
strict
;
10
use
warnings
;
11
use
bigint
;
12
13
my
$Curr
=
1
;
14
my
$Prev
=
1
;
15
my
$Sum
=
0
;
16
17
for
(;;) {
18
$Sum
=
$Curr
+
$Prev
;
19
print
(
"
$Curr
\n
"
);
20
$Curr
=
$Prev
;
21
$Prev
=
$Sum
;
22
}