std.internal.math.biguintnoasm
Arbitrary precision arithmetic ('bignum') for processors with no asm support
All functions operate on arrays of uints, stored LSB first. If there is a destination array, it will be the first parameter. Currently, all of these functions are subject to change, and are intended for internal use only. This module is intended only to assist development of high-speed routines on currently unsupported processors. The X86 asm version is about 30 times faster than the D version (DMD).
alias BigDigit
Types 1
aliasBigDigit = uint
Functions 11
fn
uint multibyteAddSub(char op)(uint[] dest, const(uint) [] src1,
const (uint) [] src2, uint carry) nothrow @safe pure @nogcMulti-byte addition or subtraction dest[] = src1[] + src2[] + carry (0 or 1). or dest[] = src1[] - src2[] - carry (0 or 1). Returns carry or borrow (0 or 1). Set op == '+' for addition, '-' for sub...fn
uint multibyteIncrementAssign(char op)(uint[] dest, uint carry) nothrow @safe pure @nogcdest[] += carry, or dest[] -= carry. op must be '+' or '-' Returns final carry or borrow (0 or 1)fn
uint multibyteShl(uint [] dest, const(uint) [] src, uint numbits) nothrow @safe pure @nogcdest[] = src[] << numbits numbits must be in the range 1 .. 31fn
void multibyteShr(uint [] dest, const(uint) [] src, uint numbits) nothrow @safe pure @nogcdest[] = src[] >> numbits numbits must be in the range 1 .. 31fn
uint multibyteMul(uint[] dest, const(uint)[] src, uint multiplier, uint carry) nothrow @safe pure @nogcdest[] = src[] * multiplier + carry. Returns carry.fn
uint multibyteMulAdd(char op)(uint [] dest, const(uint)[] src,
uint multiplier, uint carry) nothrow @safe pure @nogcdest[] += src[] * multiplier + carry(0 .. FFFF_FFFF). Returns carry out of MSB (0 .. FFFF_FFFF).fn
void multibyteMultiplyAccumulate(uint [] dest, const(uint)[] left, const(uint)
[] right) nothrow @safe pure @nogcSets result = result[0 .. left.length] + left * rightfn
uint multibyteDivAssign(uint [] dest, uint divisor, uint overflow) nothrow @safe pure @nogcdest[] /= divisor. overflow is the initial remainder, and must be in the range 0 .. divisor-1.Variables 2
enumvar
KARATSUBALIMIT = 10enumvar
KARATSUBASQUARELIMIT = 12