Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FloatSummary ¶
func Floats ¶
func Floats[T float](t ...T) FloatSummary
Floats computes summary statistics for a collection of floating-point values. If the input is float32, the returned statistics are promoted to float64.
func ReadFloats ¶ added in v1.0.2
ReadFloats reads floating-point numbers from r and computes summary statistics.
Input can be tokenized using the provided bufio.SplitFunc. If split is nil, bufio.ScanWords is used. Each token is parsed using strconv.ParseFloat with the bitSize=64. Tokens that cannot be parsed are ignored.
ReadFloats does not close r; the caller is responsible for closing it, if necessary.
If the scanner encounters an I/O error, an empty FloatSummary and the corresponding error are returned.
type IntSummary ¶
func Ints ¶
func Ints[T integer](t ...T) IntSummary
Ints computes summary statistics for a collection of integer values. The average is returned as a float64.
func ReadInts ¶ added in v1.0.2
ReadInts reads integers from r and computes summary statistics.
Input can be tokenized using the provided bufio.SplitFunc. If split is nil, bufio.ScanWords is used. Each token is parsed as an integer using strconv.Atoi. Tokens that cannot be parsed are ignored.
ReadInts does not close r; the caller is responsible for closing it, if necessary.
If the scanner encounters an I/O error, an empty IntSummary and the corresponding error are returned.