frameworks icon indicating copy to clipboard operation
frameworks copied to clipboard

mpyc mult3.py example gives result different from expected when M > 3

Open danxinnoble opened this issue 3 years ago • 1 comments

For instance: root@c609d1fbbcde:~/source# python mult3.py -M 6 2021-11-24 11:51:28,496 Start MPyC runtime v0.7 2021-11-24 11:51:28,830 All 6 parties connected. player 0 input: 4000 expected: 64000000000 result: -740248758255576370955515465 2021-11-24 11:51:28,885 Stop MPyC runtime -- elapsed time: 0:00:00.388515

danxinnoble avatar Nov 24 '21 11:11 danxinnoble

This library overflows silently, and sometimes has unexpected overflows due to intermediate values in the computation (this is more common with division). I see that 64000000000 is 35 bits, maybe it's overflowing a 32-bit integer?

marsella avatar Nov 24 '21 14:11 marsella