You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
76 B
Go
9 lines
76 B
Go
4 years ago
|
package math
|
||
|
|
||
|
func Abs(n int) int {
|
||
|
if n >= 0 {
|
||
|
return n
|
||
|
}
|
||
|
return -n
|
||
|
}
|