View source code
Display the source code in std/bigint.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

std.bigint.BigInt.this - multiple declarations

Function BigInt.this

Construct a BigInt from a decimal or hexadecimal string. The number must be in the form of a decimal or hex literal. It may have a leading + or - sign, followed by 0x or 0X if hexadecimal. Underscores are permitted in any location after the 0x and/or the sign of the number.

this(Range) (
  Range s
)
if (isBidirectionalRange!Range && isSomeChar!(ElementType!Range) && !isInfinite!Range && !isNarrowString!Range);

this(Range) (
  Range s
) pure
if (isNarrowString!Range);

Parameters

NameDescription
s a finite bidirectional range of any character type

Throws

ConvException if the string doesn't represent a valid number

Function BigInt.this

Construct a BigInt from a built-in integral type.

this(T) (
  T x
) pure nothrow
if (isIntegral!T);

Example

// @system due to failure in FreeBSD32
ulong data = 1_000_000_000_000;
auto bigData = BigInt(data);
writeln(bigData); // BigInt("1_000_000_000_000")

Function BigInt.this

Construct a BigInt from another BigInt.

this(T) (
  T x
) pure nothrow
if (is(Unqual!T == BigInt));

Example

const(BigInt) b1 = BigInt("1_234_567_890");
BigInt b2 = BigInt(b1);
writeln(b2); // BigInt("1_234_567_890")

Authors

Don Clugston

License

Boost License 1.0.