Predefinição:Mod

Permanently protected template
Origem: Wikipédia, a enciclopédia livre.
Documentação da predefinição[ver] [editar] [histórico] [purgar]

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.

Usage:

{{mod|dividend|modulus}}

Computes the modulo dynamically.

{{subst:mod|dividend|modulus|subst=subst:}}

Substitute the template invokation by its computed value when saving an article wiki source.

Examples with positive integer modulus:

  • {{mod|12|10}} = 2.
  • {{mod|10.1|10}} = 0.1.
  • {{mod|10|10}} = 0.
  • {{mod|2|10}} = 2.
  • {{mod|0|10}} = 0.
  • {{mod|-2|10}} = 8.
  • {{mod|-10|10}} = 0.
  • {{mod|-10.1|10}} = 9.9.
  • {{mod|-12|10}} = 8.

Examples with negative integer modulus:

  • {{mod|12|-10}} = -8.
  • {{mod|10.1|-10}} = -9.9.
  • {{mod|10|-10}} = 0.
  • {{mod|2|-10}} = -8.
  • {{mod|0|-10}} = 0.
  • {{mod|-2|-10}} = -2.
  • {{mod|-10|-10}} = 0.
  • {{mod|-10.1|-10}} = -0.1.
  • {{mod|-12|-10}} = -2.

Examples with positive non integer modulus:

  • {{mod|21.5|10.5}} = 0.5.
  • {{mod|21.1|10.5}} = 0.1.
  • {{mod|21|10.5}} = 0.
  • {{mod|20.9|10.5}} = 10.4.
  • {{mod|11|10.5}} = 0.5.
  • {{mod|10.6|10.5}} = 0.1.
  • {{mod|10.5|10.5}} = 0.
  • {{mod|10.1|10.5}} = 10.1.
  • {{mod|10|10.5}} = 10.
  • {{mod|2|10.5}} = 2.
  • {{mod|0|10.5}} = 0.
  • {{mod|-2|10.5}} = 8.5.
  • {{mod|-10|10.5}} = 0.5.
  • {{mod|-10.1|10.5}} = 0.4.
  • {{mod|-10.5|10.5}} = 0.
  • {{mod|-10.6|10.5}} = 10.4.
  • {{mod|-11|10.5}} = 10.
  • {{mod|-20.9|10.5}} = 0.1.
  • {{mod|-21|10.5}} = 0.
  • {{mod|-21.1|10.5}} = 10.4.
  • {{mod|-21.5|10.5}} = 10.

Examples with nul modulus:

  • {{mod|2|0}} = 0.
  • {{mod|0|0}} = 0.
  • {{mod|-2|0}} = 0.
https://pt.wikipedia.org/wiki/Predefini%C3%A7%C3%A3o:Mod
pt.wikipedia.org
crawl=CC-MAIN-2021-39
132488
application/http; msgtype=response
sha1:RIXQW7XI3X2TTF6AEZ5YLKXM7KX45ROC
<urn:uuid:e14cd8af-23a3-4cc9-9360-f8e6f35b5f0d>
2021-09-24T06:57:14Z
208.80.154.224
text/html
sha1:QDP42HYO6JUGOSF3CJ4H6E35ZXCZA5DI
<urn:uuid:f1b236f5-245c-49d6-8c8f-f63161b32498>
https://pt.wikipedia.org/wiki/Predefini%C3%A7%C3%A3o:Mod
response
<urn:uuid:e9801e84-30f4-4f25-a1dd-47311a13b08e>
isPartOf: CC-MAIN-2021-39
publisher: Common Crawl
description: Wide crawl of the web for September 2021
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-67-67-142
software: Apache Nutch 1.18 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 1.2-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/