Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Changes

Jump to: navigation, search

Template:IsEven

542 bytes added, 08:46, 11 May 2011
Created page with "<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>
== Template to test if a number is even or not ==
=== Parameters : ===
the number to test
return true if even, false if not
=== Exemple ===
<nowiki>{{IsEven|1}}</nowiki> returns {{EstPair|1}}
<nowiki>{{IsEven|21}}</nowiki> returns {{EstPair|21}}
<nowiki>{{IsEven|42}}</nowiki> returns {{EstPair|42}}
[[category:Template]]
</noinclude>

Navigation menu