Files
obitools4/pkg/obiutils/abs.go
Eric Coissac a812fe8b72 debug of obimultiplex
Former-commit-id: 1cf276840feb9d6135d96bd1bf63627d3085ae6e
2024-06-18 23:38:33 +02:00

11 lines
136 B
Go

package obiutils
import "golang.org/x/exp/constraints"
func Abs[T constraints.Signed](x T) T {
if x < 0 {
return -x
}
return x
}