diff options
Diffstat (limited to 'common/minmax.go')
-rw-r--r-- | common/minmax.go | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/common/minmax.go b/common/minmax.go deleted file mode 100644 index b670887..0000000 --- a/common/minmax.go +++ /dev/null @@ -1,27 +0,0 @@ -package common - -/* -Golang is a piece of shit. Its creators are paranoids. -*/ - -import ( - "golang.org/x/exp/constraints" -) - -type Number interface { - constraints.Integer | constraints.Float -} - -func Min[T Number](t1 T, t2 T) T { - if t1 < t2 { - return t1 - } - return t2 -} - -func Max[T Number](t1 T, t2 T) T { - if t1 > t2 { - return t1 - } - return t2 -} |