MOD

Contents


mod calculates a remainder of division.

 

Syntax

   mod(num_exp1, num_exp_2)

 

Parameters

Element

Description

Restrictions

num_exp1

Numeric Expression

None

num_exp2

Numeric Expression

None

 

Example

   Y = mod(Z, 0.5)

 

Description and Comments

mod(X,Y) returns the following:
X                          if Y is null,
X - Y*int(X/Y)     if X is positive,
-
mod(-X, Y)          if X is negative.

The result is of the Integer or Decimal type - depending on the situation.

 

Associated Errors

Error

Description

ERMODE (10)

The parameters are not numeric.

 

Associated Keywords

INT - FIX


CONTENTS


Copyright © Sage 1999 - 2007