Partager via


MOD( ) Function

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

MOD(nDividend, nDivisor)

Return Value

Numeric

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.

Remarks

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

Example

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')

See Also

Reference

% Operator (Visual FoxPro)

Other Resources

Functions