beautypg.com

Idiv – AMT Datasouth PAL User Manual

Page 118

background image

idiv

112

idiv

Description

Performs integer division of two numbers, placing the quotient back on the stack.

Usage

DividendInt DivisorInt

idiv

QuotientInt

DividendInt

Integer. Number which the interpreter will divide by DivisorInt.

DivisorInt

Integer. Number by which the interpreter will divide DividendInt.

QuotientInt

Integer. Result of integer division operation.

Comments

On most printers, PAL can perform integer division significantly faster than fixed-point division.
The speed difference becomes important in procedures which the interpreter must execute
repeated.

Integer division discards any fractional portion of the quotient. Therefore, the operation "5 2 idiv"
produces the quotient "2".