The OpenD Programming Language

UInt.opBinary

Binary operations

  1. UInt!size opBinary(UInt!rsize rhs)
    template opBinary(string op)
    const @safe pure nothrow @nogc
    UInt!size
    opBinary
    (
    size_t rsize
    )
    (
    UInt!rsize rhs
    )
    if (
    rsize <= size
    )
    if (
    op == "^" ||
    op == "|"
    ||
    op == "&"
    ||
    op == "+"
    ||
    op == "-"
    ||
    op == "*"
    ||
    op == "/"
    ||
    op == "%"
    )
  2. UInt!size opBinary(ulong rhs)
  3. UInt!size opBinary(size_t rhs)

Members

Functions

opBinary
UInt!size opBinary(UInt!rsize rhs)
UInt!size opBinary(ulong rhs)

Examples

auto a = UInt!128.fromHexString("afbbfae3cd0aff2714a1de7022b0029d");
assert(a / UInt!128.fromHexString("5") == UInt!128.fromHexString("23259893f5ceffd49db9f949a0899a1f"));
assert(a == UInt!128.fromHexString("afbbfae3cd0aff2714a1de7022b0029d"));
assert(a % UInt!128.fromHexString("5") == UInt!128.fromHexString("2"));
assert(a == UInt!128.fromHexString("afbbfae3cd0aff2714a1de7022b0029d"));

assert(a / 5 == UInt!128.fromHexString("23259893f5ceffd49db9f949a0899a1f"));
assert(a % 5 == UInt!64.fromHexString("2"));
assert(a % 5 == 2);

Meta