BigFixed.opBinary

Implements binary operators between BigFixed

struct BigFixed
pure nothrow const
opBinary
(
string op
)
(
T y
)
if (
op == "+" ||
op == "*"
||
op == "-"
||
op == "/"
)

Examples

auto b1 = BigFixed(1, 10);
assert((b1 / BigFixed(4, 10)).toDecimalString(2) == "0.25");
assert((b1 + BigFixed(2, 10)).toDecimalString(2) == "3.00");
assert((b1 * BigFixed(2, 10)).toDecimalString(2) == "2.00");
assert((b1 - BigFixed(1, 10)).toDecimalString(2) == "0.00");

Meta