BigFixed.opBinaryRight

Implements binary operators of the form Integer op BigFixed

  1. BigFixed opBinaryRight(T y)
    struct BigFixed
    pure nothrow const
    opBinaryRight
    (
    string op
    T
    )
    (
    T y
    )
    if (
    (
    op == "+" ||
    op == "*"
    ||
    op == "|"
    ||
    op == "&"
    ||
    op == "^"
    )
    &&
    isIntegral!T
    )
  2. BigFixed opBinaryRight(T y)

Examples

auto b1 = BigFixed(1, 10);
assert((1 + b1).toDecimalString(2) == "2.00");
assert((1 - b1).toDecimalString(2) == "0.00");
assert((2 * b1).toDecimalString(2) == "2.00");
assert((2 / b1).toDecimalString(2) == "2.00");
assert(((1 << 9) | b1).toDecimalString(2) == "1.50");
assert((1 & b1).toDecimalString(2) == "0.00");
assert(((1 << 9) ^ b1).toDecimalString(2) == "1.50");

Meta