Difference between revisions of "Template:IsEven"
From PlantUse English
MarcBrugman (Talk | contribs) |
MarcBrugman (Talk | contribs) |
||
Line 1: | Line 1: | ||
− | <includeonly>{{#vardefine: data|{{{1}}}}}{{#vardefine: dec|{{#expr:{{#var:data}}/2}} }}{{#vardefine:trunk|{{#expr:trunc{{#var:dec}}}} }}{{#ifeq:{{#var:dec}}|{{#var:trunk}}|true|}} | + | <includeonly>{{#vardefine: data|{{{1}}}}}{{#vardefine: dec|{{#expr:{{#var:data}}/2}} }}{{#vardefine:trunk|{{#expr:trunc{{#var:dec}}}} }}{{#ifeq:{{#var:dec}}|{{#var:trunk}}|true|}}</includeonly><noinclude> |
− | </includeonly> | + | |
− | <noinclude> | + | |
== Template to test if a number is even or not == | == Template to test if a number is even or not == | ||
=== Parameters : === | === Parameters : === |
Revision as of 09:46, 11 May 2011
Template to test if a number is even or not
Parameters :
the number to test return true if even, false if not
Exemple
{{IsEven|1}} returns {{IsEven|21}} returns {{IsEven|42}} returns true