Added math product support (#2249)

* added math product: working initial impl

* resolving merge conflicts

* impl std::ops::Mul for Filesize

* rebased with main; refactored product implementation

* fixed error msg, added docs for math product
This commit is contained in:
Gurpreet Singh
2020-08-26 22:58:01 -07:00
committed by GitHub
parent a64270829e
commit 303a9defd3
7 changed files with 219 additions and 41 deletions

View File

@ -9,6 +9,7 @@ Currently the following functions are implemented:
* `math max`: Finds the maximum within a list of numbers or tables
* `math median`: Finds the median of a list of numbers or tables
* `math sum`: Finds the sum of a list of numbers or tables
* `math product`: Finds the product of a list of numbers or tables
However, the mathematical functions like `min` and `max` are more permissive and also work on `Dates`.
@ -90,6 +91,11 @@ To get the average of the file sizes in a directory, simply pipe the size column
───┴──────────
```
```shell
> echo [2 3 3 4] | math product
72
```
### Dates
```shell