Skip to content

Commit f16c0ab

Browse files
committed
py: int: fix multiply
1 parent bf7e345 commit f16c0ab

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

py/int.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ func intMul(a, b Int) Object {
310310
if a < 0 {
311311
absA = -a
312312
}
313-
absB := a
313+
absB := b
314314
if b < 0 {
315315
absB = -b
316316
}

py/tests/int.py

+2
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@
204204
assert (-211632533027288521429006868069*-5653252500022028208) == 1196412146422513287446928630654295043023252490352
205205
assert (-2705655979939764051*498507611145963097629681977143) == -1348790099142561628919972802250477720678595086293
206206
assert (12870925392758904855337167358*-178373424945516810458926560056) == -2295831044524626990552921549255668683393970507650109852048
207+
assert 21*2432902008176640000 == 51090942171709440000
208+
assert 2432902008176640000*21 == 51090942171709440000
207209

208210
def approxEqual(a, b):
209211
assert abs(a/b - 1) < 1E-15

0 commit comments

Comments
 (0)