2 ms·
I’d bet it was just because those are easy; there is a machine instruction to compute them. Might as well use it and have one less subroutine to define later.
by db48x 5y ago
I’d bet it was just because those are easy; there is a machine instruction to compute them. Might as well use it and have one less subroutine to define later.
- nineties 5y agoThank you db48x. Yes, that's the reason. I added them to the first dictionary since these instructions are very simple even when writing in machine language. In case of mod and divmod, implementing them with add, sub and loop has a serious performance issue. Replacing it with shift operations, bit operations, add, sub and loops could be an option.