Closed shattered closed 6 months ago
I think divrem tests already cover this:
print("four%two==zero"); if four%two==zero then yes(); else no(); end if;
Sorry, I got distracted by other things... also I didn't spot that this just concerns REMU, and not REMS.
Yes, all looks good. Merging.
Trying to do the same optimisation for signed values looks like it'll be nightmare. Getting the result sign right was bad enough just for the normal divmod calculation.
Thanks --- that's definitely worth having. There are likely to be edge conditions regarding signed values, though. Could you make sure that there are tests for this case?