Skip to content

Commit 1be17ca

Browse files
committed
math
1 parent b0a9fe7 commit 1be17ca

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

util/math.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// math.go
2+
package util
3+
4+
func Abs(a int) (ret int) {
5+
ret = (a ^ a>>31) - a>>31
6+
return
7+
}

0 commit comments

Comments
 (0)