Description
Currently, the following code is used:
remainder = dividend._sign % divisor._sign;
return dividend._sign / divisor._sign;
I suggest using the system Math.DivRem. It's a bit faster because it uses only a single division, multiplication, and subtraction instead of two divisions:
int quotient = Math.DivRem(dividend._sign, divisor._sign, out int intRemainder);
remainder = intRemainder;
return quotient;
Moreover, in theory, it can use intrinsics.
Description
Currently, the following code is used:
I suggest using the system
Math.DivRem. It's a bit faster because it uses only a single division, multiplication, and subtraction instead of two divisions:Moreover, in theory, it can use intrinsics.