Mono.Math.BigInteger.Kernel.MinusEq C# (CSharp) Method

MinusEq() public static method

public static MinusEq ( BigInteger big, BigInteger small ) : void
big BigInteger
small BigInteger
return void
			public static void MinusEq (BigInteger big, BigInteger small)
			{
				uint [] b = big.data, s = small.data;
				uint i = 0, c = 0;

				do {
					uint x = s [i];
					if (((x += c) < c) | ((b [i] -= x) > ~x))
						c = 1;
					else
						c = 0;
				} while (++i < small.length);

				if (i == big.length) goto fixup;

				if (c == 1) {
					do
						b [i]--;
					while (b [i++] == 0 && i < big.length);
				}

				fixup:

					// Normalize length
					while (big.length > 0 && big.data [big.length-1] == 0) big.length--;

				// Check for zero
				if (big.length == 0)
					big.length++;

			}