In
mathematics
Mathematics is a field of study that discovers and organizes methods, Mathematical theory, theories and theorems that are developed and Mathematical proof, proved for the needs of empirical sciences and mathematics itself. There are many ar ...
, the floor function is the
function that takes as input a
real number , and gives as output the greatest
integer less than or equal to , denoted or . Similarly, the ceiling function maps to the least integer greater than or equal to , denoted or .
For example, for floor: , , and for ceiling: , and .
The floor of is also called the integral part, integer part, greatest integer, or entier of , and was historically denoted (among other notations). However, the same term, ''integer part'', is also used for
truncation towards zero, which differs from the floor function for negative numbers.
For an integer , .
Although and produce graphs that appear exactly alike, they are not the same when the value of is an exact integer. For example, when , . However, if , then , while .
Notation
The ''integral part'' or ''integer part'' of a number ( in the original) was first defined in 1798 by
Adrien-Marie Legendre in his proof of the
Legendre's formula.
Carl Friedrich Gauss introduced the square bracket notation in his third proof of
quadratic reciprocity (1808). This remained the standard in mathematics until
Kenneth E. Iverson introduced, in his 1962 book ''A Programming Language'', the names "floor" and "ceiling" and the corresponding notations and . (Iverson used square brackets for a different purpose, the
Iverson bracket notation.) Both notations are now used in mathematics, although Iverson's notation will be followed in this article.
In some sources, boldface or double brackets are used for floor, and reversed brackets or for ceiling.
The
fractional part is the
sawtooth function, denoted by for real and defined by the formula
:
For all ''x'',
:.
These characters are provided in Unicode:
*
*
*
*
In the
LaTeX
Latex is an emulsion (stable dispersion) of polymer microparticles in water. Latices are found in nature, but synthetic latices are common as well.
In nature, latex is found as a wikt:milky, milky fluid, which is present in 10% of all floweri ...
typesetting system, these symbols can be specified with the
and
commands in math mode. LaTeX has supported UTF-8 since 2018, so the Unicode characters can now be used directly. Larger versions are
and
.
Definition and properties
Given real numbers ''x'' and ''y'', integers ''m'' and ''n'' and the set of
integers
, floor and ceiling may be defined by the equations
:
:
Since there is exactly one integer in a
half-open interval of length one, for any real number ''x'', there are unique integers ''m'' and ''n'' satisfying the equation
: