Decimal.opBinary

Calculate mul and div.

  1. Decimal opBinary(const(Decimal) rhs)
  2. Decimal opBinary(long rhs)
    struct Decimal
    const @nogc nothrow pure
    opBinary
    (
    string op
    )
    (
    long rhs
    )
    if (
    op == "*" ||
    op == "/"
    )
  3. Decimal opBinary(const(Decimal) rhs)

Parameters

rhs long

other hand value.

Return Value

Type: Decimal

calculated price.

Examples

immutable a = Decimal(123456, 3);
assert(a * 2 == Decimal(246912, 3));
assert(a / 2 == Decimal(123456 / 2, 3));

Meta