David
Farruggio

MathGenie

mod

Remainder after division (modulo operation)

Syntax and Description

mod(a,m) returns the remainder after division of a by m, where a is the dividend and m is the divisor. This function is often called the modulo operation, which can be expressed as b = a - m.*floor(a./m). The mod function follows the convention that mod(a,0) returns a.

Back to functions