Skip to content

Commit

Permalink
Merge pull request #8985 from dkorpel/bigint-remove-subsimple
Browse files Browse the repository at this point in the history
std.bigint: remove subSimple
  • Loading branch information
dkorpel committed Apr 22, 2024
2 parents 375f738 + a92d08b commit e669d3e
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions std/internal/math/biguintcore.d
Expand Up @@ -2241,31 +2241,6 @@ do
return carry;
}

// result = left - right
// returns carry (0 or 1)
BigDigit subSimple(BigDigit [] result,const(BigDigit) [] left,
const(BigDigit) [] right) pure nothrow
in
{
assert(result.length == left.length,
"result and left must be of the same length");
assert(left.length >= right.length,
"left must be longer or of equal length to right");
assert(right.length > 0, "right must not be empty");
}
do
{
BigDigit carry = multibyteSub(result[0 .. right.length],
left[0 .. right.length], right, 0);
if (right.length < left.length)
{
result[right.length .. left.length] = left[right.length .. $];
carry = multibyteIncrementAssign!('-')(result[right.length..$], carry);
} //else if (result.length == left.length+1) { result[$-1] = carry; carry=0; }
return carry;
}


/* result = result - right
* Returns carry = 1 if result was less than right.
*/
Expand Down

0 comments on commit e669d3e

Please sign in to comment.