Documentation
¶
Overview ¶
Package mathutil offers some useful utility functions which are missing from the standard packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlmostEqual ¶
AlmostEqual returns true if a and b are within epsilon of one another.
func MaxOfInt ¶
MaxOfInt returns the greater of the slice of values; it will panic if the slice is empty
func MinOfInt ¶
MinOfInt returns the lesser of the slice of values; it will panic if the slice is empty
func WithinNPercent ¶
WithinNPercent returns true if a and b are within epsilon percent of one another. Strictly speaking the test is for whether the difference between a and b as a proportion of the larger value is less than epsilon. So an epsilon of 10 will test for numbers within 10% of each other Numbers with differing sign are always considered different regardless of proximity
Types ¶
This section is empty.