subu

Subtract two unsigned integers, checking for overflow (aka borrow).

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

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

Parameters

x
Type: ulong

left operand

y
Type: ulong

right operand

overflow
Type: bool

set if an overflow occurs, is not affected otherwise

Return Value

Type: ulong

the difference

Suggestion Box / Bug Report