From 4c4eb1bd8f003b3b57707badd2dd089ed193a896 Mon Sep 17 00:00:00 2001 From: wukong Date: Fri, 10 Apr 2026 23:46:12 -0700 Subject: renamed fir window generators; minor edits to whitespace and comments for more consistent style; --- binom_coeff.awk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'binom_coeff.awk') diff --git a/binom_coeff.awk b/binom_coeff.awk index a19f464..6896671 100644 --- a/binom_coeff.awk +++ b/binom_coeff.awk @@ -1,7 +1,9 @@ -#! /usr/bin/awk -f +#!/usr/bin/awk -f ### binomial coeffecient # https://rosettacode.org/wiki/Evaluate_binomial_coefficients + + function binom(n, k) { b = 1 for (i=1; i<(k+1); i++) { @@ -10,9 +12,11 @@ function binom(n, k) { return b } + BEGIN { ARGV[1] ? N = ARGV[1] : N = 1 ARGV[2] ? K = ARGV[2] : K = 1 ARGV[3] ? OFMT = "%." ARGV[3] "g" : OFMT = "%g" printf(OFMT ORS, binom(N, K)) } + -- cgit v1.2.3