3 ms·
in k: xs: 1 2 3 4 5 max: 4 min: 2 max& min| xs 2 2 3 4 4 works for scalar, vector, matrix
by tosh 6y ago
in k:
xs: 1 2 3 4 5
max: 4
min: 2
max& min| xs
2 2 3 4 4
works for scalar, vector, matrix
- Jtsummers 6y agoAfter some of the recent J posts I spent a bit of time refreshing myself on it: max <. min >. nums or equivalently: min >. max <. nums
- uryga 6y agoK made me realize that if you use the numbers 0 and 1 for booleans, `min()` is `&&` and `max()` is `||`. love that!
- tosh 6y agosame here, illuminating a-ha moment!