summaryrefslogtreecommitdiff
path: root/fib.awk
diff options
context:
space:
mode:
authorwukong <wukong@longaeva>2018-11-04 10:59:44 -0800
committerwukong <wukong@longaeva>2018-11-04 10:59:44 -0800
commite14342e827e2b42e43c006df90c7ad99e5124b3c (patch)
treec73e930f3b111bb659957df1509e7d9f5a3c8493 /fib.awk
parent72fdb25210c579beaabc35cae7ec803436887f20 (diff)
added gaussian.awk based on hamming script;
added pwr(x,p) function to sterling_approx; minor clean up all around;
Diffstat (limited to '')
-rw-r--r--fib.awk4
1 files changed, 2 insertions, 2 deletions
diff --git a/fib.awk b/fib.awk
index 07e8bab..d599caa 100644
--- a/fib.awk
+++ b/fib.awk
@@ -5,6 +5,6 @@
BEGIN {
n = ARGV[1]
- printf(OFMT ORS,
- (1.0/sqrt(5.0))*((1.0 + sqrt(5.0))/2.0)^n - (1.0/sqrt(5.0))*((1.0 - sqrt(5.0))/2.0)^n)
+ print (1/sqrt(5))*(0.5*(1 + sqrt(5)))^n - (1/sqrt(5))*(0.5*(1 - sqrt(5)))^n
}
+