mirror of
https://github.com/nushell/nushell.git
synced 2024-11-29 03:44:19 +01:00
afb7e1cf66
# Description The math functions `avg`, `max`, `median`, `min`, `product`, `stddev`, `sum` and `variance` all takes a list as input and return a number. <https://github.com/nushell/nushell/blob/main/crates/nu-command/src/math/utils.rs> contains code that makes these functions work for tables (by running the function on each column), but this functionality has not been accessible because the input types are too strict. This PR remedies this. The functions should also work on records, since a record is basically a one-row table. Most of these functions also make sense for durations and file sizes, except `product` of course. There's an implementation issue with `stddev` and `variance` for durations and file sizes, but they could in principle support it. # User-Facing Changes This PR only adds supported types, and doesn't remove any, so there should be no breaking changes. |
||
---|---|---|
.. | ||
abs.rs | ||
avg.rs | ||
ceil.rs | ||
floor.rs | ||
log.rs | ||
math_.rs | ||
max.rs | ||
median.rs | ||
min.rs | ||
mod.rs | ||
mode.rs | ||
product.rs | ||
reducers.rs | ||
round.rs | ||
sqrt.rs | ||
stddev.rs | ||
sum.rs | ||
utils.rs | ||
variance.rs |