Skip to content

Commit b859c07

Browse files
committed
math: add architecture independent maxint and maxuint
1 parent fa466a4 commit b859c07

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/math/const.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,8 @@ const (
4949
MaxUint16 = 1<<16 - 1
5050
MaxUint32 = 1<<32 - 1
5151
MaxUint64 = 1<<64 - 1
52+
MaxUint = ^uint(0)
53+
MinUint = 0
54+
MaxInt = int(MaxUint >> 1)
55+
MinInt = -MaxInt - 1
5256
)

0 commit comments

Comments
 (0)