Wikisage is op 1 na de grootste internet-encyclopedie in het Nederlands. Iedereen kan de hier verzamelde kennis gratis gebruiken, zonder storende advertenties. De Koninklijke Bibliotheek van Nederland heeft Wikisage in 2018 aangemerkt als digitaal erfgoed.
- Wilt u meehelpen om Wikisage te laten groeien? Maak dan een account aan. U bent van harte welkom. Zie: Portaal:Gebruikers.
- Bent u blij met Wikisage, of wilt u juist meer? Dan stellen we een bescheiden donatie om de kosten te bestrijden zeer op prijs. Zie: Portaal:Donaties.
Sjabloon:Floor
Dit sjabloon is verouderd
Het gebruik van dit sjabloon wordt ontraden.
Dit sjabloon kan vervangen worden door |
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.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.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 | -1 | -0 |
-0.999999999999998334665463062267 | -1 | -0 |
-0.999999999999999444888487687420 | -1 | -0 |
-0.999999999999999444888487687421 | -1 | -0 |
-0.999999999999999444888487687422 | -1 | -1 |
0.(322)01 | -1 | -0 |
0.(323)01 | -0 | -0 |