Template:Floor

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 negative numbers, the decimals will be simply dropped. For positive 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 plus infinite.


 * Usage :
 *  


 * Examples :
 *   =.
 *   =.
 *   =.
 *   =.
 *   =.
 *   =.
 *   =.
 *  </tt> =.
 *  </tt> =.
 *  </tt> =.
 *  </tt> =.
 *  </tt> =.
 *  </tt> =.
 *  </tt> =.
 *  </tt> =.
 *  </tt> =.
 *  </tt> =.


 * Known bug (should appear extremely rarely as this goes beyond the precision of math performed in pages using this template)
 *  </tt> =  (OK).
 *  </tt> =  (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 substracting 1 gives 1 exactly).
 *  </tt> =  (wrong but comes from limited floating point precision, the input is considered equal to the exact integer 1).


 *  </tt> =  (OK).
 *  </tt> =  (wrong but comes from limited floating point precision, the input is not exactly equal to the integer -1, but substracting 0.5 yields -1.5 exactly due to precision limits, which then rounds to -2).
 *  </tt> =  (OK, the input is considered equal to the exact integer -1, so this exact -1 integer is returned).


 * See also :
 * Template:Ceil

fr:Modèle:Floor