9fans / plan9port

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

hoc: fix %= operator for large values #649

Open juniskane opened 2 months ago

juniskane commented 2 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.