nxt.wideint

Provide a 2^N-bit integer type. Guaranteed to never allocate and expected binary layout Recursive implementation with very slow division.

Copied from https://raw.githubusercontent.com/d-gamedev-team/gfm/master/integers/gfm/integers/wideint.d

<b>Supports all operations that builtin integers support.</b>

TODO: Integrate representations and potential assembly optimizations from https://github.com/ckormanyos/wide-integer

Members

Aliases

SInt
alias SInt(uint bits) = Int!(true, bits)

Signed integer of arbitary static precision bits.

UInt
alias UInt(uint bits) = Int!(false, bits)

Unsigned integer of arbitary static precision bits.

int128
alias int128 = SInt!128
Undocumented in source.
int256
alias int256 = SInt!256
Undocumented in source.
uint128
alias uint128 = UInt!128
Undocumented in source.
uint256
alias uint256 = UInt!256
Undocumented in source.

Functions

abs
IntImpl!(signed, bits) abs(IntImpl!(signed, bits) x)
Undocumented in source.

Templates

isWideIntInstantiation
template isWideIntInstantiation(U)
Undocumented in source.

Bugs

it's not sure if the unsigned operand would take precedence in a comparison/division. - a < b should be an unsigned comparison if at least one operand is unsigned - a / b should be an unsigned division if at least one operand is unsigned

See Also

Meta