Home Page - YouTube Channel



Template:Floor - Simple English Wikipedia, the free encyclopedia

Template:Floor

From the Simple English Wikipedia, the free encyclopedia that anyone can change

[view] [edit] Template documentation

Implements the mathematical floor function, i.e. returns the input value if it is an integer, otherwise returns the largest integer below the input value.

For positive numbers, the decimals will be simply dropped. For negative numbers, it will also truncate the displayed decimals but the integer part of the absolute value displayed is incremented. This is the mathematical definition of the IEEE rounding mode toward minus infinite.

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}} = -1.
  • {{Floor|-0.5}} = -1.
  • {{Floor|-0.9}} = -1.
  • {{Floor|-1.0}} = -1.
  • {{Floor|-3.0}} = -3.
  • {{Floor|-3.2}} = -4.
  • {{Floor|-3.5}} = -4.
  • {{Floor|-3.9}} = -4.
Known bug (should appear extremely rarely as this goes beyond the precision of math performed in pages using this template)
  • {{Floor|0.99999999999999983}} = 0 (OK).
  • {{Floor|0.99999999999999984}} = 0 (wrong but comes from limited floating point precision, the input is 1-epsilon, adding 0.5 yields 1.5-epsilon which rounds to 2 exactly, then subtracting 1 gives 1 exactly).
  • {{Floor|0.99999999999999999}} = 1 (wrong but comes from limited floating point precision, the input is considered equal to the exact integer 1).
  • {{Floor|-0.99999999999999983}} = -1 (OK).
  • {{Floor|-0.99999999999999984}} = -2 (wrong but comes from limited floating point precision, the input is not exactly equal to the integer -1, but subtracting 0.5 yields -1.5 exactly due to precision limits, which then rounds to -2).
  • {{Floor|-0.99999999999999999}} = -1 (OK, the input is considered equal to the exact integer -1, so this exact -1 integer is returned).
num floor ceil
-0.999999999999998334665463062265 -1 0
-0.999999999999998334665463062266 -2 0
-0.999999999999998334665463062267 -2 0
-0.999999999999999444888487687420 -2 0
-0.999999999999999444888487687421 -2 0
-0.999999999999999444888487687422 -1 -1
0.(322)01 -1 1
0.(323)01 0 0
See also:

Wikipedia HTML 2008 in other languages

100 000 +

Česká (Czech)  •  English  •  Deutsch (German)  •  日本語 (Japanese)  •  Français (French)  •  Polski (Polish)  •  Suomi (Finnish)  •  Svenska (Swedish)  •  Nederlands (Dutch)  •  Español (Spanish)  •  Italiano (Italian)  •  Norsk (Norwegian Bokmål)  •  Português (Portuguese)  •  Română (Romanian)  •  Русский (Russian)  •  Türkçe (Turkish)  •  Українська (Ukrainian)  •  中文 (Chinese)

10 000 +

العربية (Arabic)  •  Български (Bulgarian)  •  Bosanski (Bosnian)  •  Català (Catalan)  •  Cymraeg (Welsh)  •  Dansk (Danish)  •  Ελληνικά (Greek)  •  Esperanto  •  Eesti (Estonian)  •  Euskara (Basque)  •  Galego (Galician)  •  עברית (Hebrew)  •  हिन्दी (Hindi)  •  Hrvatski (Croatian)  •  Magyar (Hungarian)  •  Ido  •  Bahasa Indonesia (Indonesian)  •  Íslenska (Icelandic)  •  Basa Jawa (Javanese)  •  한국어 (Korean)  •  Latina (Latin)  •  Lëtzebuergesch (Luxembourgish)  •  Lietuvių (Lithuanian)  •  Latviešu (Latvian)  •  Bahasa Melayu (Malay)  •  Plattdüütsch (Low Saxon)  •  Norsk (Norwegian Nynorsk)  •  فارسی (Persian)  •  Sicilianu (Sicilian)  •  Slovenčina (Slovak)  •  Slovenščina (Slovenian)  •  Српски (Serbian)  •  Basa Sunda (Sundanese)  •  தமிழ் (Tamil)  •  ไทย (Thai)  •  Tiếng Việt (Vietnamese)

1 000 +

Afrikaans  •  Asturianu (Asturian)  •  Беларуская (Belarusian)  •  Kaszëbsczi (Kashubian)  •  Frysk (Western Frisian)  •  Gaeilge (Irish)  •  Interlingua  •  Kurdî (Kurdish)  •  Kernewek (Cornish)  •  Māori  •  Bân-lâm-gú (Southern Min)  •  Occitan  •  संस्कृत (Sanskrit)  •  Scots  •  Tatarça (Tatar)  •  اردو (Urdu) Walon (Walloon)  •  יידיש (Yiddish)  •  古文/文言文 (Classical Chinese)

100 +

Nehiyaw (Cree)  •  словѣньскъ (Old Church Slavonic)  •  gutisk (Gothic)  •  ລາວ (Laos)