Performs size_t overflow = (big += overflow) *= scalar operatrion.
Performs uint remainder = (overflow$big) /= scalar operatrion, where $ denotes big-endian concatenation. Precondition: overflow < rhs
Performs size_t overflow = (big += overflow) *= fixed operatrion.
Performs size_t overflow = big *= fixed operatrion.
count of 64bit words in coefficient
import mir.bignum.fixed; import mir.bignum.low_level_view; auto a = BigInt!4.fromHexString("4b313b23aa560e1b0985f89cbe6df5460860e39a64ba92b4abdd3ee77e4e05b8"); auto b = BigInt!4.fromHexString("c39b18a9f06fd8e962d99935cea0707f79a222050aaeaaaed17feb7aa76999d7"); auto c = BigInt!4.fromHexString("7869dd864619cace5953a09910327b3971413e6aa5f417fa25a2ac93291b941f"); c.sign = true; assert(a != b); assert(a < b); a -= b; assert(a.sign); assert(a == c); a -= a; assert(!a.sign); assert(!a.length); auto d = BigInt!4.fromHexString("0de1a911c6dc8f90a7169a148e65d22cf34f6a8254ae26362b064f26ac44218a"); assert((b *= 0x7869dd86) == 0x5c019770); assert(b == d); d = BigInt!4.fromHexString("856eeb23e68cc73f2a517448862cdc97e83f9dfa23768296724bf00fda7df32a"); auto o = b *= UInt!128.fromHexString("f79a222050aaeaaa417fa25a2ac93291"); assert(o == UInt!128.fromHexString("d6d15b99499b73e68c3331eb0f7bf16")); assert(b == d); d = BigInt!4.fromHexString("d"); // initial value d.mulPow5(60); c = BigInt!4.fromHexString("81704fcef32d3bd8117effd5c4389285b05d"); assert(d == c); d >>= 80; c = BigInt!4.fromHexString("81704fcef32d3bd8"); assert(d == c); c = BigInt!4.fromHexString("c39b18a9f06fd8e962d99935cea0707f79a222050aaeaaaed17feb7aa76999d7"); d = BigInt!4.fromHexString("9935cea0707f79a222050aaeaaaed17feb7aa76999d700000000000000000000"); c <<= 80; assert(d == c); c >>= 80; c <<= 84; d <<= 4; assert(d == c); assert(c != b); b.sign = true; assert(!c.copyFrom(b.view)); assert(c == b); b >>= 18; auto bView = cast(BigIntView!ushort)b.view; assert(!c.copyFrom(bView.topLeastSignificantPart(bView.unsigned.coefficients.length - 1))); assert(c == b);
Stack-allocated big signed integer.