Floor and ceiling functions explained

In mathematics, 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 smallest integer greater than or equal to, denoted or .[1]

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).[2] 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 x is an exact integer. For example, when =2.0001; . However, if =2, then, while .

2220
2.0001230.0001
2.4230.4
2.9230.9
2.999230.999
-2.7-3-20.3
-2-2-20

Notation

The integral part or integer part of a number (French: partie entière 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).[3] This remained the standard[4] in mathematics until Kenneth E. Iverson introduced, in his 1962 book A Programming Language, the names "floor" and "ceiling" and the corresponding notations and .[5] [6] (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.[7] [8]

The fractional part is the sawtooth function, denoted by for real and defined by the formula

[9]

For all x,

.

These characters are provided in Unicode:

In the LaTeX typesetting system, these symbols can be specified with the {{mono|\lceil, \rceil, \lfloor, }} and {{mono|\rfloor}} commands in math mode. LaTeX has supported UTF-8 since 2018, so the Unicode characters can now be used directly.[10] Larger versions are{{mono|\left\lceil, \right\rceil, \left\lfloor,}} and {{mono|\right\rfloor}}.

Definition and properties

Given real numbers x and y, integers m and n and the set of integers

Z

, floor and ceiling may be defined by the equations

\lfloorx\rfloor=max\{m\inZ\midm\lex\},

\lceilx\rceil=min\{n\inZ\midn\gex\}.

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

x-1<m\lex\len<x+1.

where

\lfloorx\rfloor=m

 and

\lceilx\rceil=n

 may also be taken as the definition of floor and ceiling.

Equivalences

These formulas can be used to simplify expressions involving floors and ceilings.[11]

\begin{alignat}{3} \lfloorx\rfloor&=m  &&ifandonlyif&m&\lex<m+1,\\ \lceilx\rceil&=n&&ifandonlyif&  n-1&<x\len,\\ \lfloorx\rfloor&=m&&ifandonlyif&x-1&<m\lex,\\ \lceilx\rceil&=n&&ifandonlyif&x&\len<x+1. \end{alignat}

In the language of order theory, the floor function is a residuated mapping, that is, part of a Galois connection: it is the upper adjoint of the function that embeds the integers into the reals.

\begin{align} x<n&  ifandonlyif&\lfloorx\rfloor&<n,\\ n<x&  ifandonlyif&n&<\lceilx\rceil,\\ x\len&  ifandonlyif&\lceilx\rceil&\len,\\ n\lex&  ifandonlyif&n&\le\lfloorx\rfloor. \end{align}

These formulas show how adding an integer to the arguments affects the functions:

\begin{align} \lfloorx+n\rfloor&=\lfloorx\rfloor+n,\\ \lceilx+n\rceil&=\lceilx\rceil+n,\\ \{x+n\}&=\{x\}. \end{align}

The above are never true if is not an integer; however, for every and, the following inequalities hold:

\begin{align} \lfloorx\rfloor+\lfloory\rfloor&\leq\lfloorx+y\rfloor\leq\lfloorx\rfloor+\lfloory\rfloor+1,\\[3mu] \lceilx\rceil+\lceily\rceil-1&\leq\lceilx+y\rceil\leq\lceilx\rceil+\lceily\rceil. \end{align}

Monotonicity

Both floor and ceiling functions are monotonically non-decreasing functions:

\begin{align} x1\lex2&\lfloorx1\rfloor\le\lfloorx2\rfloor,\\ x1\lex2&\lceilx1\rceil\le\lceilx2\rceil.\end{align}

Relations among the functions

It is clear from the definitions that

\lfloorx\rfloor\le\lceilx\rceil,

  with equality if and only if x is an integer, i.e.

\lceilx\rceil-\lfloorx\rfloor=\begin{cases} 0&ifx\inZ\\ 1&ifx\not\inZ \end{cases}

In fact, for integers n, both floor and ceiling functions are the identity:

\lfloorn\rfloor=\lceiln\rceil=n.

Negating the argument switches floor and ceiling and changes the sign:

\begin{align} \lfloorx\rfloor+\lceil-x\rceil&=0\\ -\lfloorx\rfloor&=\lceil-x\rceil\\ -\lceilx\rceil&=\lfloor-x\rfloor \end{align}

and:

\lfloorx\rfloor+\lfloor-x\rfloor=\begin{cases} 0&ifx\inZ\\ -1&ifx\not\inZ, \end{cases}

\lceilx\rceil+\lceil-x\rceil=\begin{cases} 0&ifx\inZ\\ 1&ifx\not\inZ. \end{cases}

Negating the argument complements the fractional part:

\{x\}+\{-x\}=\begin{cases} 0&ifx\inZ\\ 1&ifx\not\inZ. \end{cases}

The floor, ceiling, and fractional part functions are idempotent:

\begin{align} \lfloor\lfloorx\rfloor\rfloor&=\lfloorx\rfloor,\\ \lceil\lceilx\rceil\rceil&=\lceilx\rceil,\\ \{\{x\}\}&=\{x\}. \end{align}

The result of nested floor or ceiling functions is the innermost function:

\begin{align} \lfloor\lceilx\rceil\rfloor&=\lceilx\rceil,\\ \lceil\lfloorx\rfloor\rceil&=\lfloorx\rfloor \end{align}

due to the identity property for integers.

Quotients

If m and n are integers and n ≠ 0,

0\le\left\{

m
n

\right\}\le1-

1
|n|

.

If n is a positive integer[12]

\left\lfloorx+m
n

\right\rfloor=\left\lfloor

\lfloorx\rfloor+m
n

\right\rfloor,

\left\lceilx+m
n

\right\rceil=\left\lceil

\lceilx\rceil+m
n

\right\rceil.

If m is positive[13]

n=\left\lceiln\vphantom1
m

\right\rceil+\left\lceil

n-1
m

\right\rceil+...+\left\lceil

n-m+1
m

\right\rceil,

n=\left\lfloorn\vphantom1
m

\right\rfloor+\left\lfloor

n+1
m

\right\rfloor+...+\left\lfloor

n+m-1
m

\right\rfloor.

For m = 2 these imply

n=\left\lfloor

n\vphantom1
2

\right\rfloor+\left\lceil

n\vphantom1
2

\right\rceil.

More generally,[14] for positive m (See Hermite's identity)

\lceilmx\rceil=\left\lceilx\right\rceil+\left\lceilx-

1
m

\right\rceil+...+\left\lceilx-

m-1
m

\right\rceil,

\lfloormx\rfloor=\left\lfloorx\right\rfloor+\left\lfloorx+

1
m

\right\rfloor+...+\left\lfloorx+

m-1
m

\right\rfloor.

The following can be used to convert floors to ceilings and vice versa (m positive)[15]

\left\lceil

n\vphantom1
m

\right\rceil=\left\lfloor

n+m-1
m

\right\rfloor=\left\lfloor

n-1
m

\right\rfloor+1,

\left\lfloor

n\vphantom1
m

\right\rfloor=\left\lceil

n-m+1
m

\right\rceil=\left\lceil

n+1
m

\right\rceil-1,

For all m and n strictly positive integers:[16]

n-1
\sum
k=1

\left\lfloor

km
n

\right\rfloor=

(m-1)(n-1)+\gcd(m,n)-1
2,

which, for positive and coprime m and n, reduces to

n-1
\sum
k=1

\left\lfloor

km
n

\right\rfloor=\tfrac{1}{2}(m-1)(n-1),

and similarly for the ceiling and fractional part functions (still for positive and coprime m and n),

n-1
\sum
k=1

\left\lceil

km
n

\right\rceil=\tfrac{1}{2}(m+1)(n-1),

n-1
\sum
k=1

\left\{

km
n

\right\}=\tfrac{1}{2}(n-1).

Since the right-hand side of the general case is symmetrical in m and n, this implies that

\left\lfloor

m\vphantom1
n

\right\rfloor+\left\lfloor

2m
n

\right\rfloor+...+\left\lfloor

(n-1)m
n

\right\rfloor= \left\lfloor

n\vphantom1
m

\right\rfloor+\left\lfloor

2n
m

\right\rfloor+...+\left\lfloor

(m-1)n
m

\right\rfloor.

More generally, if m and n are positive,

\begin{align} &\left\lfloor

x\vphantom1
n

\right\rfloor+ \left\lfloor

m+x
n

\right\rfloor+ \left\lfloor

2m+x
n

\right\rfloor+ ...+ \left\lfloor

(n-1)m+x
n

\right\rfloor\\[5mu] = &\left\lfloor

x\vphantom1
m

\right\rfloor+ \left\lfloor

n+x
m

\right\rfloor+ \left\lfloor

2n+x
m

\right\rfloor+ + \left\lfloor

(m-1)n+x
m

\right\rfloor. \end{align}

This is sometimes called a reciprocity law.[17]

Division by positive integers gives rise to an interesting and sometimes useful property. Assuming

m,n>0

,

m\leq\left\lfloor

x
n

\right\rfloor\iffn\leq\left\lfloor

x
m

\right\rfloor\iffn\leq

\lfloorx\rfloor
m

.

Similarly,

m\geq\left\lceil

x
n

\right\rceil\iffn\geq\left\lceil

x
m

\right\rceil\iffn\geq

\lceilx\rceil
m

.

Indeed,

m\leq\left\lfloor

x
n

\right\rfloor\impliesm\leq

x
n

\impliesn\leq

x
m

\impliesn\leq\left\lfloor

x
m

\right\rfloor\implies\ldots\impliesm\leq\left\lfloor

x
n

\right\rfloor,

keeping in mind that \lfloor x/n \rfloor = \bigl\lfloor \lfloor x \rfloor / n \bigr\rfloor.The second equivalence involving the ceiling function can be proved similarly.

Nested divisions

For positive integer n, and arbitrary real numbers m,x:[18]

\left\lfloor

\lfloorx/m\rfloor
n

\right\rfloor=\left\lfloor

x
mn

\right\rfloor

\left\lceil

\lceilx/m\rceil
n

\right\rceil=\left\lceil

x
mn

\right\rceil.

Continuity and series expansions

None of the functions discussed in this article are continuous, but all are piecewise linear: the functions

\lfloorx\rfloor

,

\lceilx\rceil

, and

\{x\}

have discontinuities at the integers.

\lfloorx\rfloor

  is upper semi-continuous and  

\lceilx\rceil

  and

\{x\}

  are lower semi-continuous.

Since none of the functions discussed in this article are continuous, none of them have a power series expansion. Since floor and ceiling are not periodic, they do not have uniformly convergent Fourier series expansions. The fractional part function has Fourier series expansion[19] \= \frac - \frac \sum_^\infty\frac for not an integer.

At points of discontinuity, a Fourier series converges to a value that is the average of its limits on the left and the right, unlike the floor, ceiling and fractional part functions: for y fixed and x a multiple of y the Fourier series given converges to y/2, rather than to x mod y = 0. At points of continuity the series converges to the true value.

Using the formula

\lfloorx\rfloor=x-\{x\}

gives\lfloor x\rfloor = x - \frac + \frac \sum_^\infty \frac for not an integer.

Applications

Mod operator

For an integer x and a positive integer y, the modulo operation, denoted by x mod y, gives the value of the remainder when x is divided by y. This definition can be extended to real x and y, y ≠ 0, by the formula

x\bmody=x-y\left\lfloor

x
y

\right\rfloor.

Then it follows from the definition of floor function that this extended operation satisfies many natural properties. Notably, x mod y is always between 0 and y, i.e.,

if y is positive,

0\lex\bmody<y,

and if y is negative,

0\gex\bmody>y.

Quadratic reciprocity

Gauss's third proof of quadratic reciprocity, as modified by Eisenstein, has two basic steps.[20] [21]

Let p and q be distinct positive odd prime numbers, and let

m=\tfrac12(p-1),

n=\tfrac12(q-1).

First, Gauss's lemma is used to show that the Legendre symbols are given by

\begin{align} \left(q
p

\right) &=

\left\lfloorq\right\rfloor+
\left\lfloor2q
p
\right\rfloor+ ...+
\left\lfloormq
p
\right\rfloor
p
(-1)

,\\[5mu] \left(

p
q

\right) &=

\left\lfloorp\right\rfloor+
\left\lfloor2p
q
\right\rfloor+ ...+
\left\lfloornp
q
\right\rfloor
q
(-1)

. \end{align}

The second step is to use a geometric argument to show that

\left\lfloorq
p

\right\rfloor+\left\lfloor

2q
p

\right\rfloor+...+\left\lfloor

mq\right\rfloor +\left\lfloor
p
p
q

\right\rfloor+\left\lfloor

2p
q

\right\rfloor+...+\left\lfloor

np
q

\right\rfloor =mn.

Combining these formulas gives quadratic reciprocity in the form

\left(p
q

\right)\left(

q
p

\right)=(-1)mn

p-1
q-1
2
2
=(-1)

.

There are formulas that use floor to express the quadratic character of small numbers mod odd primes p:[22]

\begin{align} \left(2
p

\right)&=

\left\lfloorp+1\right\rfloor
4
(-1)

,\\[5mu] \left(

3
p

\right)&=

\left\lfloorp+1\right\rfloor
6
(-1)

. \end{align}

Rounding

For an arbitrary real number

x

, rounding

x

to the nearest integer with tie breaking towards positive infinity is given by

rpi(x)=\left\lfloorx+\tfrac{1}{2}\right\rfloor=\left\lceil\tfrac12\lfloor2x\rfloor\right\rceil

; rounding towards negative infinity is given as

rni(x)=\left\lceilx-\tfrac{1}{2}\right\rceil=\left\lfloor\tfrac12\lceil2x\rceil\right\rfloor

.

If tie-breaking is away from 0, then the rounding function is

ri(x)=sgn(x)\left\lfloor|x|+\tfrac{1}{2}\right\rfloor

(see sign function), and rounding towards even can be expressed with the more cumbersome

\lfloorx\rceil=\left\lfloorx+\tfrac{1}{2}\right\rfloor+l\lceil\tfrac14(2x-1)r\rceil-l\lfloor\tfrac14(2x-1)r\rfloor-1

, which is the above expression for rounding towards positive infinity

rpi(x)

minus an integrality indicator for

\tfrac14(2x-1)

.

x

to the nearest integer value forms a very basic type of quantizer – a uniform one. A typical (mid-tread) uniform quantizer with a quantization step size equal to some value

\Delta

can be expressed as

Q(x)=\Delta\left\lfloor

x
\Delta

+

1
2

\right\rfloor

,

Number of digits

The number of digits in base b of a positive integer k is

\lfloorlogb{k}\rfloor+1=\lceillogb{(k+1)}\rceil.

Number of strings without repeated characters

The number of possible strings of arbitrary length that doesn't use any character twice is given by[23]

(n)0++(n)n=\lflooren!\rfloor

where:

(n)k=n(n-1)(n-k+1)

denotes the number of strings of length that don't use any character twice.

For = 26, this comes out to 1096259850353149530222034277.

Factors of factorials

Let n be a positive integer and p a positive prime number. The exponent of the highest power of p that divides n! is given by a version of Legendre's formula[24]

\left\lfloorn
p

\right\rfloor+\left\lfloor

n
p2

\right\rfloor+\left\lfloor

n
p3

\right\rfloor+...=

n-\sumkak
p-1

where n = \sum_a_kp^k is the way of writing n in base p. This is a finite sum, since the floors are zero when pk > n.

Beatty sequence

The Beatty sequence shows how every positive irrational number gives rise to a partition of the natural numbers into two sequences via the floor function.[25]

Euler's constant (γ)

There are formulas for Euler's constant γ = 0.57721 56649 ... that involve the floor and ceiling, e.g.[26]

\gamma

infty\left({1\over\lfloor
=\int
1

x\rfloor}-{1\overx}\right)dx,

\gamma=\limn

1
n
n
\sum
k=1

\left(\left\lceil

n
k

\right\rceil-

n
k

\right),

and

\gamma=

infty
\sum
k=2

(-1)k

\left\lfloorlog2k\right\rfloor
k

=\tfrac12-\tfrac13 +2\left(\tfrac14-\tfrac15+\tfrac16-\tfrac17\right) +3\left(\tfrac18--\tfrac1{15}\right)+

Riemann zeta function (ζ)

The fractional part function also shows up in integral representations of the Riemann zeta function. It is straightforward to prove (using integration by parts)[27] that if

\varphi(x)

is any function with a continuous derivative in the closed interval [''a'', ''b''],

\suma<n\le\varphi(n)

b\varphi(x)
= \int
a

dx

b\left(\{x\}-\tfrac12\right)\varphi'(x)
+ \int
a

dx+ \left(\{a\}-\tfrac12\right)\varphi(a)- \left(\{b\}-\tfrac12\right)\varphi(b).

Letting

\varphi(n)=n-s

for real part of s greater than 1 and letting a and b be integers, and letting b approach infinity gives

\zeta(s)=

infty
12-\{x\
s\int
1
}\,dx + \frac + \frac 1 2.

This formula is valid for all s with real part greater than -1, (except s = 1, where there is a pole) and combined with the Fourier expansion for can be used to extend the zeta function to the entire complex plane and to prove its functional equation.[28]

For s = σ + it in the critical strip 0 < σ < 1,

infty
\zeta(s)=s\int
-infty

e-\sigma\omega(\lfloore\omega\rfloor-e\omega)e-it\omegad\omega.

In 1947 van der Pol used this representation to construct an analogue computer for finding roots of the zeta function.[29]

Formulas for prime numbers

The floor function appears in several formulas characterizing prime numbers. For example, since \bigl\lfloor\frac \bigr\rfloor -\bigl\lfloor\frac\bigr\rfloor is equal to 1 if m divides n, and to 0 otherwise, it follows that a positive integer n is a prime if and only if[30]

infty
\sum\left(l\lfloor
m=1
nr\rfloor-l\lfloor
m
n-1
m

r\rfloor\right)=2.

One may also give formulas for producing the prime numbers. For example, let pn be the n-th prime, and for any integer r > 1, define the real number α by the sum

\alpha=

infty
\sum
m=1

pm

-m2
r

.

Then[31]

pn=\left\lfloor

n2
r

\alpha\right\rfloor-r2n-1\left\lfloor

(n-1)2
r

\alpha\right\rfloor.

A similar result is that there is a number θ = 1.3064... (Mills' constant) with the property that

\left\lfloor\theta3\right\rfloor,\left\lfloor\theta9\right\rfloor,\left\lfloor\theta27\right\rfloor,...

are all prime.[32]

There is also a number ω = 1.9287800... with the property that

\left\lfloor2\omega\right\rfloor,\left\lfloor

2\omega
2

\right\rfloor,\left\lfloor

2\omega
2
2

\right\rfloor,...

are all prime.[32]

Let (x) be the number of primes less than or equal to x. It is a straightforward deduction from Wilson's theorem that[33]

\pi(n)=

nl\lfloor(j-1)!+1
j
\sum
j=2

-\left\lfloor

(j-1)!
j

\right\rfloorr\rfloor.

Also, if n ≥ 2,[34]

\pi(n)=

n
\sum
j=2

l\lfloor1

j\left\lfloor\left\lfloorj
k
/{\sum\right\rfloor
k=2
k
j

\right\rfloor}r\rfloor.

None of the formulas in this section are of any practical use.[35] [36]

Solved problems

Ramanujan submitted these problems to the Journal of the Indian Mathematical Society.[37]

If n is a positive integer, prove that

  1. \left\lfloor\tfrac{n}{3}\right\rfloor+\left\lfloor\tfrac{n+2}{6}\right\rfloor+\left\lfloor\tfrac{n+4}{6}\right\rfloor=\left\lfloor\tfrac{n}{2}\right\rfloor+\left\lfloor\tfrac{n+3}{6}\right\rfloor,

  2. \left\lfloor\tfrac12+\sqrt{n+\tfrac12}\right\rfloor=\left\lfloor\tfrac12+\sqrt{n+\tfrac14}\right\rfloor,

  3. \left\lfloor\sqrt{n}+\sqrt{n+1}\right\rfloor=\left\lfloor\sqrt{4n+2}\right\rfloor.

Some generalizations to the above floor function identities have been proven.[38]

Unsolved problem

The study of Waring's problem has led to an unsolved problem:

Are there any positive integers k ≥ 6 such that[39]

3k-2kl\lfloorl(\tfrac32r)kr\rfloor>2k-l\lfloorl(\tfrac32r)kr\rfloor-2?

Mahler has proved there can only be a finite number of such k; none are known.[40]

Computer implementations

In most programming languages, the simplest method to convert a floating point number to an integer does not do floor or ceiling, but truncation. The reason for this is historical, as the first machines used ones' complement and truncation was simpler to implement (floor is simpler in two's complement). FORTRAN was defined to require this behavior and thus almost all processors implement conversion this way. Some consider this to be an unfortunate historical design decision that has led to bugs handling negative offsets and graphics on the negative side of the origin.

An arithmetic right-shift of a signed integer

x

by

n

is the same as

\left\lfloorx/2n\right\rfloor

. Division by a power of 2 is often written as a right-shift, not for optimization as might be assumed, but because the floor of negative results is required. Assuming such shifts are "premature optimization" and replacing them with division can break software.

Many programming languages (including C, C++,[41] [42] C#,[43] [44] Java,[45] [46] PHP,[47] [48] R,[49] and Python[50]) provide standard functions for floor and ceiling, usually called floor and ceil, or less commonly ceiling.[51] The language APL uses ⌊x for floor. The J Programming Language, a follow-on to APL that is designed to use standard keyboard symbols, uses <. for floor and >. for ceiling.[52] ALGOL usesentier for floor.

In Microsoft Excel the funtion INT rounds down rather than toward zero,[53] while FLOOR rounds toward zero, the opposite of what "int" and "floor" do in other languages. Since 2010 FLOOR has been changed to error if the number is negative.[54] The OpenDocument file format, as used by OpenOffice.org, Libreoffice and others, INT[55] and FLOOR both do floor, and FLOOR has a third argument to reproduce Excel's earlier behavior.[56]

See also

References

External links

Notes and References

  1. Graham, Knuth, & Patashnik, Ch. 3.1
  2. 1) Luke Heaton, A Brief History of Mathematical Thought, 2015, (n.p.)
    2) Albert A. Blank et al., Calculus: Differential Calculus, 1968, p. 259
    3) John W. Warris, Horst Stocker, Handbook of mathematics and computational science, 1998,, p. 151
  3. Lemmermeyer, pp. 10, 23.
  4. e.g. Cassels, Hardy & Wright, and Ribenboim use Gauss's notation. Graham, Knuth & Patashnik, and Crandall & Pomerance use Iverson's.
  5. Iverson, p. 12.
  6. Higham, p. 25.
  7. http://www.mathwords.com/f/floor_function.htm Mathwords: Floor Function
  8. http://www.mathwords.com/c/ceiling_function.htm Mathwords: Ceiling Function
  9. Graham, Knuth, & Patashnik, p. 70.
  10. Web site: LaTeX News, Issue 28 . Apr 2018 . The LaTeX Project . PDF; 379 KB . 2024-07-27.
  11. Graham, Knuth, & Patashink, Ch. 3
  12. Graham, Knuth, & Patashnik, p. 73
  13. Graham, Knuth, & Patashnik, p. 85
  14. Graham, Knuth, & Patashnik, p. 85 and Ex. 3.15
  15. Graham, Knuth, & Patashnik, Ex. 3.12
  16. Graham, Knuth, & Patashnik, p. 94.
  17. Graham, Knuth, & Patashnik, p. 94
  18. Graham, Knuth, & Patashnik, p. 71, apply theorem 3.10 with x/m as input and the division by n as function
  19. Titchmarsh, p. 15, Eq. 2.1.7
  20. Lemmermeyer, § 1.4, Ex. 1.32–1.33
  21. Hardy & Wright, §§ 6.11–6.13
  22. Lemmermeyer, p. 25
  23. (See Formulas.)
  24. Hardy & Wright, Th. 416
  25. Graham, Knuth, & Patashnik, pp. 77–78
  26. These formulas are from the Wikipedia article Euler's constant, which has many more.
  27. Titchmarsh, p. 13
  28. Titchmarsh, pp.14–15
  29. Crandall & Pomerance, p. 391
  30. Crandall & Pomerance, Ex. 1.3, p. 46. The infinite upper limit of the sum can be replaced with n. An equivalent condition is n > 1 is prime if and only if \sum_^ \bigl(\bigl\lfloor\frac\bigr\rfloor-\bigl\lfloor\frac\bigr\rfloor\bigr) = 1 .
  31. Hardy & Wright, § 22.3
  32. Ribenboim, p. 186
  33. Ribenboim, p. 181
  34. Crandall & Pomerance, Ex. 1.4, p. 46
  35. Ribenboim, p. 180 says that "Despite the nil practical value of the formulas ... [they] may have some relevance to logicians who wish to understand clearly how various parts of arithmetic may be deduced from different axiomatzations ... "
  36. Hardy & Wright, pp. 344—345 "Any one of these formulas (or any similar one) would attain a different status if the exact value of the number α ... could be expressed independently of the primes. There seems no likelihood of this, but it cannot be ruled out as entirely impossible."
  37. Ramanujan, Question 723, Papers p. 332
  38. Somu . Sai Teja . Kukla . Andrzej . On some generalizations to floor function identities of Ramanujan . Integers . 2022 . 22. 2109.03680 .
  39. Hardy & Wright, p. 337
  40. Mahler . Kurt . Kurt Mahler. On the fractional parts of the powers of a rational number II. 1957. Mathematika. 4. 2 . 122–124. 10.1112/S0025579300001170.
  41. Web site: C++ reference of floor function . 5 December 2010.
  42. Web site: C++ reference of ceil function . 5 December 2010.
  43. Web site: Math.Floor Method (System). dotnet-bot. docs.microsoft.com. en-us. 28 November 2019.
  44. Web site: Math.Ceiling Method (System). dotnet-bot. docs.microsoft.com. en-us. 28 November 2019.
  45. Web site: Math (Java SE 9 & JDK 9). docs.oracle.com. en. 20 November 2018.
  46. Web site: Math (Java SE 9 & JDK 9). docs.oracle.com. en. 20 November 2018.
  47. Web site: PHP manual for ceil function . 18 July 2013.
  48. Web site: PHP manual for floor function . 18 July 2013.
  49. Web site: R: Rounding of Numbers.
  50. Web site: Python manual for math module . 18 July 2013.
  51. Sullivan, p. 86.
  52. Web site: Vocabulary. J Language. 6 September 2011.
  53. Web site: INT function . 29 October 2021.
  54. Web site: FLOOR function . 29 October 2021.
  55. Web site: Documentation/How Tos/Calc: INT function . 29 October 2021.
  56. Web site: Documentation/How Tos/Calc: FLOOR function . 29 October 2021.