number

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaxNumber

func MaxNumber[V int32 | int64 | float32 | float64](numbers ...V) (V, error)

MaxNumber returns the maximum value from a list of numbers.

The function takes a variadic parameter of type V, which can be int32, int64, float32, or float64. It returns the maximum value found and an error if the list is empty.

func MinNumber

func MinNumber[V int32 | int64 | float32 | float64](numbers ...V) (V, error)

MinNumber finds and returns the minimum number from a variadic list of numbers.

It takes in one or more numbers of type int32, int64, float32, or float64. It returns the minimum number found from the given list of numbers and an error.

func StrToInts added in v0.2.0

func StrToInts(s string) ([]int, error)

StrToInts converts a string to a slice of integers.

It takes a string as input and returns a slice of integers and an error.

Types

type Number added in v0.2.0

type Number interface {
	uint | uint8 | uint16 | uint32 | uint64 | int | int8 | int16 | int32 | int64 | float32 | float64 | complex64 | complex128
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL