Skip to content

Commit 32e35ae

Browse files
committed
math: fix compile on 32 bit systems
1 parent 9e5c0d4 commit 32e35ae

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

math/math.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -882,9 +882,9 @@ func math_ldexp(self py.Object, args py.Tuple) (py.Object, error) {
882882
return nil, err
883883
}
884884
if lt == py.True {
885-
exp = py.IntMin
885+
exp = py.GoIntMin
886886
} else {
887-
exp = py.IntMax
887+
exp = py.GoIntMax
888888
}
889889
}
890890
if x == 0. || !isFinite(x) {

py/int.go

+5
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ const (
3535
IntMin = math.MinInt64
3636
// The largest number such that sqrtIntMax**2 < IntMax
3737
sqrtIntMax = 3037000499
38+
// Go integer limits
39+
GoUintMax = ^uint(0)
40+
GoUintMin = 0
41+
GoIntMax = int(GoUintMax >> 1)
42+
GoIntMin = -GoIntMax - 1
3843
)
3944

4045
// Type of this Int object

0 commit comments

Comments
 (0)