Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,22 @@
|
|||
term() {
|
||||
b=$1;res=$2
|
||||
echo "scale=5;$res+$b" | bc
|
||||
}
|
||||
|
||||
sum() {
|
||||
(read B; res=$1;
|
||||
test -n "$B" && (term $B $res) || (term 0 $res))
|
||||
}
|
||||
|
||||
fold() {
|
||||
func=$1
|
||||
(while read a ; do
|
||||
fold $func | $func $a
|
||||
done)
|
||||
}
|
||||
|
||||
mean() {
|
||||
tee >(wc -l > count) | fold sum | xargs echo "scale=5;(1/" $(cat count) ") * " | bc
|
||||
}
|
||||
|
||||
(echo 3; echo 1; echo 4) | mean
|
||||
Loading…
Add table
Add a link
Reference in a new issue