Documentation ¶
Overview ¶
Package sint is a basic math library for int.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Log10 ¶
Log10 returns the log10(i), rounded down to a whole integer. i must be positive.
Example ¶
package main import ( "fmt" "github.com/google/gapid/core/math/sint" ) func main() { for _, n := range []int{0, 1, 2, 9, 10, 11, 99, 100, 101} { fmt.Printf("Log10(%v): %v\n", n, sint.Log10(n)) } }
Output: Log10(0): 0 Log10(1): 0 Log10(2): 0 Log10(9): 0 Log10(10): 1 Log10(11): 1 Log10(99): 1 Log10(100): 2 Log10(101): 2
Types ¶
type Histogram ¶ added in v1.2.0
type Histogram []int
Histogram represents a series of integer values, for the purpose of computing statistics about them.
func (*Histogram) Add ¶ added in v1.2.0
Add adds `count` to the Histogram at position `at`, zero-extending the Histogram if necessary.
func (*Histogram) Stats ¶ added in v1.2.0
func (h *Histogram) Stats() HistogramStats
Stats computes average, standard deviation, and median statistics on the values in the Histogram. See HistogramStats for more details.
type HistogramStats ¶ added in v1.2.0
type HistogramStats struct { // Average is the mean of all the values in the Histogram. Average float64 // Stddev is the population standard deviation of the values in the // Histogram. Stddev float64 // Median is the median value of the values in the Histogram. Median int }
HistogramStats stores the result of computing statistics on a Histogram
Click to show internal directories.
Click to hide internal directories.