BigInt.this

this(T x) pure @safe
No documentation available for this declaration.
this(string s) pure @safe
No documentation available for this declaration.
this(bool isNegative, Range magnitude) pure @safe

Constructs a BigInt from a sign and magnitude.

This constructor creates a BigInt from a boolean sign flag and a range of magnitude digits (limbs).

Parameters

isNegativetrue if the value should be negative, false otherwise
magnitudeRange of magnitude digits in little-endian order (least significant digit first) Example:
// Construct from array of limbs
auto a = BigInt(false, [1UL, 2UL, 3UL]);  // Positive: limbs = [1, 2, 3]
auto b = BigInt(true, [1UL, 2UL, 3UL]);   // Negative: limbs = [1, 2, 3]

// Construct from empty range (zero)
auto c = BigInt(false, (ulong[]).init);  // Zero
this(Range s) pure @safe

Constructs a BigInt from a bidirectional range of characters.

This constructor accepts any bidirectional range of characters and parses it to create a BigInt. Supports decimal and hexadecimal formats (with "0x" prefix).

Parameters

sBidirectional range of characters representing the number Example:
import std.conv : to;

// Construct from string range
auto a = BigInt("12345");

// Construct from array of chars
auto b = BigInt(['1', '2', '3']);

// Construct from hex string
auto c = BigInt("0xFF");