Documentation ¶
Index ¶
- func AbsInt32(i int32) uint32
- func BigFloat0() *big.Float
- func BigFloatMaxUint64() *big.Float
- func BigPow10(exponent uint64) *big.Int
- func ConvertBigFloatSliceToUint64Slice(values []*big.Float) ([]uint64, error)
- func ConvertBigFloatToUint64(value *big.Float) (uint64, error)
- func ConvertStringSliceToBigFloatSlice(values []string) ([]*big.Float, error)
- func GetSortedKeys[R interface{ ... }, K comparable, V any](m map[K]V) []K
- func Median[V uint64 | uint32 | int64 | int32](input []V) (V, error)
- func Min[T constraints.Ordered](x, y T) T
- type Sortable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BigFloatMaxUint64 ¶
BigFloatMaxUint64 returns a `big.Float` that is set to MaxUint64.
func BigPow10 ¶
BigPow10 returns the result of `10^exponent`. Caches all calculated values and re-uses cached values in any following calls to BigPow10.
func ConvertBigFloatSliceToUint64Slice ¶
ConvertBigFloatSliceToUint64Slice attempts to convert all values in a slice from big Float to uint64 and return an error if any conversions fail. Note: during conversion, will always round down.
func ConvertBigFloatToUint64 ¶
ConvertBigFloatToUint64 attempts to convert a big Float into a uint64 and returns an error if the conversion would fail. Note: during conversion, will always round down.
func ConvertStringSliceToBigFloatSlice ¶
ConvertStringSliceToBigFloatSlice attempts to convert all values in a slice from string to big Float and return an error if any conversions fail.
func GetSortedKeys ¶
func GetSortedKeys[R interface { ~[]K sort.Interface }, K comparable, V any](m map[K]V) []K
GetSortedKeys returns the keys of the map in sorted order.
func Median ¶
Median is a generic median calculator. If the input has an even number of elements, then the average of the two middle numbers is rounded away from zero.
func Min ¶
func Min[T constraints.Ordered](x, y T) T
Types ¶
type Sortable ¶
type Sortable[K constraints.Ordered] []K
Sortable[K] attaches the methods of sort.Interface to []K, sorting in increasing order.