added sum function to shellscript version
This commit is contained in:
parent
25ea50ae8a
commit
10ab8da848
@ -8,3 +8,9 @@ function mul { echo $(($1*$2)); }
|
||||
function div { echo $(($1/$2)); }
|
||||
function mdl { echo $(($1%$2)); }
|
||||
function randr { echo $(($1+$RANDOM%$2)); }
|
||||
function sum {
|
||||
for i in $@; do
|
||||
acc=$((acc+i))
|
||||
done
|
||||
echo $acc
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user