Template:Ceil: Difference between revisions

From Vigyanwiki
Template>Verdy p
mNo edit summary
 
Template>Verdy p
mNo edit summary
Line 1: Line 1:
<includeonly>{{#ifexpr:({{{1}}})=(({{{1}}})round 0)|{{#expr:({{{1}}})+0}}|{{#ifexpr:({{{1}}})<0 and ({{{1}}})>-1|0|{{#expr:-((0.5-({{{1}}}))round 0)}}}}}}</includeonly><noinclude>{{Template documentation}}
<includeonly>{{#ifexpr:({{{1}}})=(({{{1}}})round 0)|{{#expr:{{{1}}}}}|{{#ifexpr:({{{1}}})<0 and ({{{1}}})>-1|0|{{#expr:-((-({{{1}}})-0.5)round 0)}}}}}}</includeonly><noinclude>{{Template documentation}}
Implements the mathematical [[ceil function]].
Implements the mathematical [[ceil function]].



Revision as of 02:19, 25 April 2006

Template:Template documentation Implements the mathematical ceil function.

Usage:
{{ceil|value}}
Examples:
  • {{ceil|3.9}} = 4.
  • {{ceil|3.5}} = 4.
  • {{ceil|3.1}} = 4.
  • {{ceil|3.0}} = 3.
  • {{ceil|1.0}} = 1.
  • {{ceil|0.9}} = 1.
  • {{ceil|0.5}} = 1.
  • {{ceil|0.1}} = 1.
  • {{ceil|0.0}} = 0.
  • {{ceil|-0.1}} = 0.
  • {{ceil|-0.5}} = 0.
  • {{ceil|-0.9}} = 0.
  • {{ceil|-1.0}} = -1.
  • {{ceil|-3.0}} = -3.
  • {{ceil|-3.2}} = -3.
  • {{ceil|-3.5}} = -3.
  • {{ceil|-3.9}} = -3.
See also: