2.1.16.1.10 mod


Description

Divides x by y and returns the remainder.

The arithmetic is same with c/c++, but not same with Excel.

Syntax

long mod( long x, long y )

Parameters

x
[input] dividend
y
[input] divisor

Return

remainder of division of x by y

Examples

EX1

void    mod_ex1()
{
    int        m = 36, n = 10;
    long    nmod = mod(m, n);
    
    printf("mod(%d, %d) = %d\n", m, n, nmod);
}

Remark

See Also

rmod, mod2

Header to Include

origin.h

Reference