BigFixed.opOpAssign

Implements assignment operators from built-in integers of the form BigFixed op= Integer

  1. BigFixed opOpAssign(T y)
  2. BigFixed opOpAssign(T y)
    struct BigFixed
    pure nothrow
    opOpAssign
    (
    string op
    T
    )
    (
    T y
    )
    if (
    (
    op == "+" ||
    op == "-"
    ||
    op == "*"
    ||
    op == "/"
    ||
    op == ">>"
    ||
    op == "<<"
    )
    &&
    isIntegral!T
    )

Examples

auto b1 = BigFixed(1, 10);
b1 /= 4;
assert(b1.toDecimalString(2) == "0.25");
b1 += 1;
assert(b1.toDecimalString(2) == "1.25");
b1 *= 2;
assert(b1.toDecimalString(2) == "2.50");
b1 -= 1;
assert(b1.toDecimalString(2) == "1.50");
b1 <<= 1;
assert(b1.toDecimalString(2) == "3.00");
b1 >>= 2;
assert(b1.toDecimalString(2) == "0.75");

Meta