BigFixed.opBinary

Implements binary operators between BigInt

  1. BigFixed opBinary(T y)
  2. BigFixed opBinary(T y)
    struct BigFixed
    pure nothrow const
    opBinary
    (
    string op
    T : BigInt
    )
    (
    T y
    )
    if (
    op == "|" ||
    op == "&"
    ||
    op == "^"
    )
  3. BigFixed opBinary(T y)

Examples

auto b1 = BigFixed(1, 10);
assert((b1 | (BigInt(1) << 9)).toDecimalString(2) == "1.50");
assert((b1 & (BigInt(1) << 9)).toDecimalString(2) == "0.00");
assert((b1 ^ (BigInt(1) << 9)).toDecimalString(2) == "1.50");

Meta