The OpenD Programming Language

subs

Subtract two signed integers, checking for overflow.

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

  1. int subs(int x, int y, bool overflow)
  2. long subs(long x, long y, bool overflow)
  3. cent subs(cent x, cent y, bool overflow)
    nothrow @safe @nogc pure pragma(inline, true)
    static if(is(cent))
    cent
    subs
    (
    cent x
    ,
    cent y
    ,
    scope ref bool overflow
    )

Parameters

x cent

left operand

y cent

right operand

overflow bool

set if an overflow occurs, is not affected otherwise

Return Value

Type: cent

the difference

Meta