ebooksgratis.com

See also ebooksgratis.com: no banners, no cookies, totally FREE.

CLASSICISTRANIERI HOME PAGE - YOUTUBE CHANNEL
Privacy Policy Cookie Policy Terms and Conditions
Template:Floor - Wikipedia, the free encyclopedia

Template:Floor

From Wikipedia, the free encyclopedia

[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 infinity.

Usage:
{{Floor|value}}.

Due to the new built-in floor function the template only provides the minor convenience of writing {{Floor|value}} instead of {{#expr:floor(value)}}; inside the expression of #expr or #ifexpr it is not useful, since "floor(value)" is shorter than "{{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.

Note:

  • {{Floor|0.99999999999999983}} = 0 (OK).
  • {{Floor|0.99999999999999999}} = 1 (wrong but comes from limited floating point precision, the input is rounded to 1 before applying the floor function)
  • "{{#expr:floor 0.99999999999999999}}" gives "1" [1] (ditto)
  • "{{#expr:floor (1-1e-17)}}" gives "1" [2] (ditto)
  • "{{#expr:floor 0.9999999999999999444888487687422}}" gives "1" [3] (ditto)
  • "{{#expr:floor 0.9999999999999999444888487687421}}" gives "0" [4] (OK)
  • "{{#expr:floor (1-1e-16)}}" gives "0" [5] (OK)

Correspondingly:

  • "{{#expr:1- 0.9999999999999999444888487687422}}" gives "0" [6]
  • "{{#expr:1- 0.9999999999999999444888487687421}}" gives "1.1102230246252E-16" [7]


  • {{Floor|-0.99999999999999983}} = -1 (OK).
  • {{Floor|-1.00000000000000001}} = -1 (wrong but comes from limited floating point precision, the input is rounded to -1 before applying the floor function).
num floor ceil
0.999999999999999444888487687421 0 1
0.999999999999999444888487687422 1 1
0.(322)01 -1 -0
0.(323)01 0 0
See also:


aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -