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, ref bool overflow)
  2. ulong addu(ulong x, ulong y, ref bool overflow)
  3. ucent addu(ucent x, ucent y, ref bool overflow)
    pragma(inline, true)
    ucent
    addu
    ()
    (
    ucent x
    ,
    ucent y
    ,
    ref bool overflow
    )

Parameters

x
Type: ucent

left operand

y
Type: ucent

right operand

overflow
Type: bool

set if an overflow occurs, is not affected otherwise

Return Value

Type: ucent

the sum

Suggestion Box / Bug Report