Multiply()

Namespace ›› System ›› MfInt64 ›› Methods ››
Parent Previous Next

Multiply()

OutputVar := instance.Multiply(value)

Multiply(value)

Multiplies the current instance of MfInt64 by the value.

Parameters

value

The value to multiply the current instance Value by.
Can be any type that matches IsNumber. or var number.

Returns

If ReturnAsObject is true then returns current instance of MfInt64 with an updated Value; Otherwise returns Value as var.

Throws

Throws MfNotSupportedException if Readonly is true.
Throws MfNullReferenceException if called as a static method
Throws MfArgumentNullException if value is null.
Throws MfDivideByZeroException if value is zero.
Throws MfArithmeticException if the operation fails or value is not an instance of MfInt64 and can not be converted into integer value.
Throws MfArgumentOutOfRangeException if dividing result is less then MinValue and greater than MaxValue

Remarks

If the result of the operation is not a whole number such as 4*3 but rather a float number such as 4*3.3 (4 * 3.2 = 13.2) then the result will always be the whole number portion of the operation. For example:

mfInt := new MfInt64(4)
MsgBox % mfInt.Multiply(3.2) ; displays 12

mfInt.Value := 4
MsgBox % mfInt.Multiply(-3.2) ; displays -12

If you need to work with decimal/float numbers see MfFloat

Example

i := new MfInt64(80, true) ; create new MfInt64 and set it RetrunAsObject to value to true

iNew := new MfInt64(8)
MsgBox % i.Multiply(iNew).Value ; displays 640
Msgbox % i.Add(-5).Value ; displays 635
MsgBox % i.Add(10).Multiply(2).Value ; displays 1290