You can not select more than 25 topics
Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- package math2
-
- import "golang.org/x/exp/constraints"
-
- func Max[T constraints.Ordered](v1, v2 T) T {
- if v1 < v2 {
- return v2
- }
-
- return v1
- }
-
- func Min[T constraints.Ordered](v1, v2 T) T {
- if v1 < v2 {
- return v1
- }
-
- return v2
- }
|