BigInt.opUnary

BigInt opUnary(string op)() if (op == "+" || op == "-" || op == "~") const pure @safe

Implements unary operators +, -, ~ for BigInt.

Parameters

opThe operator string ("+", "-", or "~")

Returns

- For "+": a copy of this BigInt (identity operation)
  • For "-": the negation of this BigInt
  • For "~": the bitwise complement of this BigInt (defined as -(this+1))
BigInt opUnary(string op)() if (op == "++" || op == "--") ref pure @safe

Implements pre-increment (++) and pre-decrement (--) operators for BigInt.

Parameters

opThe operator string ("++" or "--")

Returns

Reference to this BigInt after modification