9fans / plan9port

Plan 9 from User Space
https://9fans.github.io/plan9port/
Other
1.64k stars 326 forks source link

hoc: fix %= operator for large values #649

Open juniskane opened 6 months ago

juniskane commented 6 months ago

Operator %= calculated different values than ordinary modulus operator:

a=1e20 a % 47 18 a %= 47 print a -36

Also add division-by-zero check to /= and %= operators.