Time for an 2014 update…
This commit is contained in:
parent
372c577f83
commit
09687c4926
2520 changed files with 34227 additions and 7318 deletions
|
|
@ -0,0 +1,17 @@
|
|||
# syntax: GAWK -f TRABB_PARDO-KNUTH_ALGORITHM.AWK
|
||||
BEGIN {
|
||||
printf("enter 11 numbers: ")
|
||||
getline S
|
||||
n = split(S,arr," ")
|
||||
if (n != 11) {
|
||||
printf("%d numbers entered; S/B 11\n",n)
|
||||
exit(1)
|
||||
}
|
||||
for (i=n; i>0; i--) {
|
||||
x = f(arr[i])
|
||||
printf("f(%s) = %s\n",arr[i],(x>400) ? "too large" : x)
|
||||
}
|
||||
exit(0)
|
||||
}
|
||||
function abs(x) { if (x >= 0) { return x } else { return -x } }
|
||||
function f(x) { return sqrt(abs(x)) + 5 * x ^ 3 }
|
||||
Loading…
Add table
Add a link
Reference in a new issue