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
In mathematics, a real number is a number that can be used to measure a continuous one- dimensional quantity such as a duration or temperature. Here, ''continuous'' means that pairs of values can have arbitrarily small differences. Every re ...
, and gives as output the greatest
integer
An integer is the number zero (0), a positive natural number (1, 2, 3, ...), or the negation of a positive natural number (−1, −2, −3, ...). The negations or additive inverses of the positive natural numbers are referred to as negative in ...
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
Johann Carl Friedrich Gauss (; ; ; 30 April 177723 February 1855) was a German mathematician, astronomer, geodesist, and physicist, who contributed to many fields in mathematics and science. He was director of the Göttingen Observatory and ...
introduced the square bracket notation in his third proof of
quadratic reciprocity
In number theory, the law of quadratic reciprocity is a theorem about modular arithmetic that gives conditions for the solvability of quadratic equations modulo prime numbers. Due to its subtlety, it has many formulations, but the most standard st ...
(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
integer
An integer is the number zero (0), a positive natural number (1, 2, 3, ...), or the negation of a positive natural number (−1, −2, −3, ...). The negations or additive inverses of the positive natural numbers are referred to as negative in ...
s
, 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
: