Function Div(x, y)

Div

Div(
    x,      ! (input) numerical expression
    y       ! (input) numerical expression
    )

Arguments

x

A scalar numerical expression.

y

A scalar numerical expression unequal to 0.

Return Value

The function Div returns \(x\) divided by \(y\) rounded down to an integer.

Example

_p_returnA := div( 8, 3 ); ! div( 8, 3 ) =   2
_p_returnB := div( 8,-3 ); ! div( 8,-3 ) =  -3
_p_returnC := div(-8, 3 ); ! div(-8, 3 ) =  -3
_p_returnD := div(-8,-3 ); ! div(-8,-3 ) =   2

Note

A run-time error results if y equals 0.

See also