blob: 3c719788ea5524e18a2eb875eee183f396fe4099 [file] [log] [blame]
// Title: Generic min
package main
import (
"fmt"
"constraints"
)
func min[P constraints.Ordered](x, y P) P {
if x < y {
return x
} else {
return y
}
}
func main() {
fmt.Println(min(42, 24))
}