Progress
Language Reference


MODULO Operator

Interfaces
OS
SpeedScript
All
All
Yes

Determines the remainder after division.

SYNTAX

expression MODULO base 

expression

An integer expression.

base

A positive integer expression that is the modulo base. For example, angles measured in degrees use a base of 360 for modulo arithmetic. 372 MODULO 360 is 12.

EXAMPLE

This procedure determines the number of trucks required to ship a given quantity of material, and how much material is left over from a less than full truck load.

r-modulo.p
REPEAT:
  SET qty-avail AS INTEGER LABEL "Qty. Avail.".
  SET std-cap AS INTEGER
  LABEL "Std. Truck Capacity".
  DISPLAY TRUNCATE(qty-avail / std-cap,0)
    FORMAT ">,>>9" LABEL "# Full Loads"
    qty-avail MODULO std-cap LABEL "Qty. Left".
END. 

NOTE

The expression must be greater than 0 for MODULO to return a correct value.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095