From b859c07c9db97300a4ef9edd8e6f83bd1f6aa7c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Fischer?= Date: Thu, 1 Nov 2018 21:29:50 +0100 Subject: [PATCH] math: add architecture independent maxint and maxuint --- src/math/const.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/math/const.go b/src/math/const.go index 0fc8715dd07ce0..3ca23a5dd35e16 100644 --- a/src/math/const.go +++ b/src/math/const.go @@ -49,4 +49,8 @@ const ( MaxUint16 = 1<<16 - 1 MaxUint32 = 1<<32 - 1 MaxUint64 = 1<<64 - 1 + MaxUint = ^uint(0) + MinUint = 0 + MaxInt = int(MaxUint >> 1) + MinInt = -MaxInt - 1 )