Links are not active on this page.
 MOD( ) Function

Divides one numeric expression by another numeric expression and returns the remainder.

MOD(nDividend, nDivisor)

Parameters

nDividend

Specifies the dividend. The number of decimal places in nDividend determines the number of decimal places in the return value.

nDivisor

Specifies the divisor. A positive number is returned if nDivisor is positive, and a negative number is returned if nDivisor is negative.

Expand imageReturn Value

Numeric

Expand imageRemarks

The modulus function MOD( ) and the % operator return identical results.

Expand imageExample

 CopyCode imageCopy Code
CLEAR
? MOD(36,10)  && Displays 6
? MOD((4*9), (90/9))  && Displays 6
? MOD(25.250,5.0)  && Displays 0.250
? IIF(MOD(YEAR(DATE( )), 4) = 0, 'Summer Olympics this year';
   , 'No Summer Olympics this year')

Expand imageSee Also

Reference

% Operator (Visual FoxPro)

Other Resources

Functions