1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-17 03:02:28 +08:00

feat: add Max, Min, and Average function

This commit is contained in:
dudaodong
2022-03-22 10:26:43 +08:00
parent 41613061d5
commit c4b0967623
3 changed files with 54 additions and 0 deletions

View File

@@ -11,3 +11,8 @@ type Comparator interface {
// Descending order: should return 1 -> v1 < v2, 0 -> v1 = v2, -1 -> v1 > v2
Compare(v1, v2 any) int
}
// Number contains all types of number and uintptr, used for generics constraint
type Number interface {
int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 | uintptr | float32 | float64
}