Skip to content

Commit 24ddaf7

Browse files
committed
cmd/dist: show an example in the command doc
1 parent 18e49ef commit 24ddaf7

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

cmd/dist/dist.go

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
1-
// dist reads newline-separated numbers from stdin and describes their
2-
// distribution.
1+
// dist reads newline-separated numbers and describes their distribution.
2+
//
3+
// For example,
4+
//
5+
// $ seq 1 20 | grep -v 1 | dist
6+
// N 9 sum 64 mean 7.11111 gmean 5.78509 std dev 5.34894 variance 28.6111
7+
//
8+
// min 2
9+
// 1%ile 2
10+
// 5%ile 2
11+
// 25%ile 3.66667
12+
// median 6
13+
// 75%ile 8.33333
14+
// 95%ile 20
15+
// 99%ile 20
16+
// max 20
17+
//
18+
// ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣠⠖⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⠦⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡖ 0.1
19+
// ⠀⠀⠀⠀⠀⠀⠀⢀⣠⠴⠊⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠲⢤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇
20+
// ⠠⠤⠤⠤⠤⠴⠒⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠑⠲⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠴⠒⠋⠉⠉⠀⠀⠉⠉⠙⠒⠦⠤⠤⠤⠤⠄⠧ 0.0
21+
// ⠈⠉⠉⠉⠉⠙⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠋⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠋⠉⠉⠉⠉⠉⠉⠉⠉⠉⠁
22+
// 0 10 20
323
package main
424

525
import (

0 commit comments

Comments
 (0)