User:17jiangz1/Mod

Explain xkcd: It's 'cause you're dumb.
< User:17jiangz1
Revision as of 08:52, 4 May 2015 by 17jiangz1 (talk | contribs) (Created page with "<includeonly>{{ {{{|safesubst:}}}#ifexpr:({{{2}}})=0|0|{{ {{{|safesubst:}}}#ifexpr:(({{{1}}})/({{{2}}}))=((({{{1}}})/({{{2}}}))round 0)|0|{{ {{{|safesubst:}}}#ifexpr:(({{{1}}}...")
(diff) ← Older revision | Latest revision (diff) | Newer revision β†’ (diff)
Jump to: navigation, search

From wikipedia

Implements the mathematical modulo operator. The returned result is always of the same sign as the modulus or nul, and its absolute value is lower than the absolute value of the modulus. However, this template returns 0 if the modulus is nul (this template should never return a division by zero error). This template is not the same as the mod operator in the #expr parser function, which first truncates both operands to an integer before calculating the remainder.

This template can be substituted.

Usage:
{{mod|dividend|modulus}}
Computes the modulo dynamically.
{{subst:mod|dividend|modulus}}
Substitute the template invokation by its computed value when saving an article wiki source.
Examples with positive integer modulus:
Examples with negative integer modulus:
Examples with positive non integer modulus:
Examples with nul modulus:

See also[edit]