Add a simple absolute value function.

This commit is contained in:
Anna Rose 2018-12-12 15:06:59 -05:00
parent 28998c5d14
commit bd7cc5ce68
No known key found for this signature in database
GPG Key ID: 8D9ACA841015C59A

View File

@ -0,0 +1,8 @@
package util
func abs(x int) int {
if x < 0 {
return -x
}
return x
}