muls

Multiply 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 muls(int x, int y, ref bool overflow)
  2. long muls(long x, long y, ref bool overflow)
  3. cent muls(cent x, cent y, ref bool overflow)
    pragma(inline, true)
    cent
    muls
    ()
    (
    cent x
    ,
    cent y
    ,
    ref bool overflow
    )

Parameters

x
Type: cent

left operand

y
Type: cent

right operand

overflow
Type: bool

set if an overflow occurs, is not affected otherwise

Return Value

Type: cent

the product

Suggestion Box / Bug Report