mulu

Multiply two unsigned integers, checking for overflow (aka carry).

The overflow is sticky, meaning a sequence of operations can be done and overflow need only be checked at the end.

  1. uint mulu(uint x, uint y, ref bool overflow)
    nothrow @safe @nogc pure pragma(inline, true)
    uint
    mulu
    ()
    (
    uint x
    ,
    uint y
    ,
    ref bool overflow
    )
  2. ulong mulu(ulong x, uint y, ref bool overflow)
  3. ulong mulu(ulong x, ulong y, ref bool overflow)
  4. ucent mulu(ucent x, ucent y, ref bool overflow)

Parameters

x
Type: uint

left operand

y
Type: uint

right operand

overflow
Type: bool

set if an overflow occurs, is not affected otherwise

Return Value

Type: uint

the product

Suggestion Box / Bug Report