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.

Function std.bigint.BigInt.opEquals

Implements BigInt equality test with other BigInt's and built-in numeric types.

bool opEquals (
  auto const ref BigInt y
) const pure @nogc @safe;

bool opEquals(T) (
  const T y
) const pure nothrow @nogc @safe
if (isIntegral!T);

bool opEquals(T) (
  const T y
) const nothrow @nogc
if (isFloatingPoint!T);

Example

// Note that when comparing a BigInt to a float or double the
// full precision of the BigInt is always considered, unlike
// when comparing an int to a float or a long to a double.
assert(BigInt(123456789) != cast(float) 123456789);

Authors

Don Clugston

License

Boost License 1.0.