Automation Engine Script Guide > Ordered by Function > Arithmetics > MOD

MOD

Script Function: It returns the remainder of a division.

Syntax

MOD(Operand1, Operand2)

Syntax

Description/Format

Operand1

The first expression.
Format: script literal, script variable or number specified without quotation marks.

Operand2

The second expression.
Format: scriptA particular Automation Engine object type. literal, script variableA placeholder for a value within a script. or number specified without quotation marks.


Return code

Remainder of the division

Comments

This script functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,… returns the remainder of the division of Operand1 by Operand2.

Operand1 and Operand2 must be integers that are within the allowed value ranges of the data types "unsigned" and "signed". Floating point numbers are not supported. The result is always a positive or negative integer. 

Operand2 must not be zero.

Examples

In the following example, this function returns the result "1".

:SET &rest# = MOD(10,3)

The result of the second example is "10".

:SET &rest# = MOD(10,44)

 

See also:

Script element Description

ADD

Performs an addition.
SUB Performs a subtraction.
MULT Performs a multiplication.
DIV Performs a division.
RANDOM Generates random numbers.

Script Elements - Arithmetics

About Scripts
Script Elements - Alphabetical Listing

Script Elements - Ordered by function

 


Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support

Copyright © 2016 Automic Software GmbH