FixedBinary.opBinary

FixedBinary opBinary(string op)(FixedBinary rhs) if (op == "+" || op == "-") const

Fixed-point addition/subtraction. Overflows wrap like the storage integer (explicit unsigned arithmetic, as in C fixed-point code).

Parameters

rhsthe other operand.

Returns

The sum or difference, wrapping on overflow.
FixedBinary opBinary(string op)(I rhs) if (op == "+" || op == "-" || op == "*") const

Integer addition/subtraction at the current scale, and integer multiplication. Overflows wrap like the storage integer.

Parameters

rhsthe integer operand.

Returns

The result, wrapping on overflow.
FixedBinary opBinary(string op)(FixedBinary rhs) if (op == "*") const @safe pure nothrow @nogc

Fixed-point multiplication with the default rounding policy.

Parameters

rhsfixed-point factor.

Returns

the product, wrapping after scale reduction.