Added math abs command. (#2789)

This commit is contained in:
xolve
2020-12-15 22:07:12 +05:30
committed by GitHub
parent 83c874666a
commit f377a3a7b4
6 changed files with 90 additions and 4 deletions

View File

@ -3,6 +3,7 @@
Mathematical functions that generally only operate on a list of numbers (integers, decimals, bytes) and tables.
Currently the following functions are implemented:
* `math abs`: Returns absolute values of a list of numbers
* `math avg`: Finds the average of a list of numbers or tables
* `math ceil`: Applies the ceil function to a list of numbers
* [`math eval`](math-eval.md): Evaluates a list of math expressions into numbers
@ -147,6 +148,15 @@ To get the average of the file sizes in a directory, simply pipe the size column
───┴────
```
```shell
> echo [1 -2 -3.0] | math abs
───┬────────
01
12
2 │ 3.0000
───┴────────
```
### Dates
```shell