The OpenD Programming Language

addu

Add 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 addu(uint x, uint y, bool overflow)
  2. ulong addu(ulong x, ulong y, bool overflow)
  3. ucent addu(ucent x, ucent y, bool overflow)
    nothrow @safe @nogc pure pragma(inline, true)
    static if(is(ucent))
    ucent
    addu
    (
    ucent x
    ,
    ucent y
    ,
    scope ref bool overflow
    )

Parameters

x ucent

left operand

y ucent

right operand

overflow bool

set if an overflow occurs, is not affected otherwise

Return Value

Type: ucent

the sum

Meta