Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Floor and ceiling functions
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Equivalences=== These formulas can be used to simplify expressions involving floors and ceilings.<ref>Graham, Knuth, & Patashink, Ch. 3</ref> :<math> \begin{alignat}{3} \lfloor x \rfloor &= m \ \ &&\mbox{ if and only if } &m &\le x < m+1,\\ \lceil x \rceil &= n &&\mbox{ if and only if } &\ \ n -1 &< x \le n,\\ \lfloor x \rfloor &= m &&\mbox{ if and only if } &x-1 &< m \le x,\\ \lceil x \rceil &= n &&\mbox{ if and only if } &x &\le n < x+1. \end{alignat} </math> 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. :<math> \begin{align} x<n &\;\;\mbox{ if and only if } &\lfloor x \rfloor &< n, \\ n<x &\;\;\mbox{ if and only if } &n &< \lceil x \rceil, \\ x\le n &\;\;\mbox{ if and only if } &\lceil x \rceil &\le n, \\ n\le x &\;\;\mbox{ if and only if } &n &\le \lfloor x \rfloor. \end{align} </math> These formulas show how adding an integer {{mvar|n}} to the arguments affects the functions: :<math> \begin{align} \lfloor x+n \rfloor &= \lfloor x \rfloor+n,\\ \lceil x+n \rceil &= \lceil x \rceil+n,\\ \{ x+n \} &= \{ x \}. \end{align} </math> The above are never true if {{mvar|n}} is not an integer; however, for every {{mvar|x}} and {{mvar|y}}, the following inequalities hold: :<math>\begin{align} \lfloor x \rfloor + \lfloor y \rfloor &\leq \lfloor x + y \rfloor \leq \lfloor x \rfloor + \lfloor y \rfloor + 1,\\[3mu] \lceil x \rceil + \lceil y \rceil -1 &\leq \lceil x + y \rceil \leq \lceil x \rceil + \lceil y \rceil. \end{align}</math>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)