Fixed.opBinaryRight

struct Fixed(int scaling, V = long, Hook = KeepScalingHook)
const
opBinaryRight
(
string op
Lhs
)
(
const Lhs lhs
)
if (
isIntegral!Lhs ||
isFloatingPoint!Lhs
||
is(Lhs == bool)
)
if (
isIntegral!V
)

Examples

auto p1 = Fixed!4(1);
auto p2 = Fixed!4(2);
assert(p1 + 1 == 2);
assert(p1 + p2 == 3);
assert(p1 * 2 == 2);
assert(cast(double)(p1 / 2) == 0.5);
auto p3 = Fixed!2(2);
auto p4 = p2 + p3.to!(Fixed!4);
assert(p4 == 4);

Meta