Closed jopperm closed 1 year ago
Done. (diff)
For future reference, given a % b
:
a
determines the sign of the expression.a
is positive, the result is in the range [0, min(a, |b|-1)]
a
is negative, the result is in the range [max(a, -|b|+1), 0]
signed<w1> % unsigned<u2>
case:
signed<6> a = -28;
unsigned<4> b = 15;
a % b == -13 ∉ signed<4>
From the wiki-spec: https://github.com/Minres/CoreDSL/wiki/Expressions#modulus