Template:Floor: Difference between revisions

From Vigyanwiki
No 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:(({{{1}}})-0.5)round 0}}}}}}</includeonly><noinclude>{{Template documentation}}
<includeonly>{{#ifexpr:({{{1}}})=(({{{1}}})round 0)|{{#expr:{{{1}}}}}|{{#ifexpr:({{{1}}})>0|{{#expr:((({{{1}}})+0.5)round 0)-1}}|{{#expr:1-((0.5-({{{1}}}))round 0)}}}}}}</includeonly><noinclude>{{Template documentation}}
Implements the mathematical [[floor function]].
Implements the mathematical [[floor function]].



Revision as of 12:03, 3 May 2006

Template:Template documentation Implements the mathematical floor function.

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