Skip to main content
Contents Index
Dark Mode Prev Up Next
\(\newcommand{\im}{{\mathrm{im}}}
\newcommand{\given}{{\, :\,}}
\newcommand{\hanoi}{\mathrm{hanoi}}
\newcommand{\lcm}{{\mathrm{lcm}}}
\newcommand{\ID}{{\mathrm{ID}}}
\newcommand{\chr}{{\mathtt{chr}}}
\newcommand{\ord}{{\mathtt{ord}}}
\newcommand{\set}[1]{\left\lbrace #1 \right\rbrace}
\newcommand{\seq}[2]{( #1 )_{#2}}
\newcommand{\gr}[1]{\left( #1 \right)}
\newcommand{\abs}[1]{\left| #1 \right|}
\newcommand{\size}[1]{\# #1}
\newcommand{\id}[1]{\mathrm{id}_{#1}}
\newcommand{\ip}[1]{\left\langle #1 \right\rangle}
\newcommand{\floor}[1]{\left\lfloor #1\right\rfloor}
\newcommand{\ceiling}[1]{\left\lceil #1\right\rceil}
\newcommand{\indemph}[1]{{\textbf{\emph{#1}}\index{#1}}}
\renewcommand{\implies}{\to}
\renewcommand{\iff}{\leftrightarrow}
\newcommand{\lxor}{\oplus}
\newcommand{\cP}{\wp}
\newcommand{\pset}{\cP}
\newcommand{\ZZ}{\mathbb{Z}}
\newcommand{\QQ}{\mathbb{Q}}
\newcommand{\NN}{\mathbb{N}}
\newcommand{\CC}{\mathbb{C}}
\newcommand{\RR}{\mathbb{R}}
\newcommand{\barr}[1]{\overline{#1}}
\newcommand{\sage}{\textsc{Sage}}
\newcommand{\magma}{\textsc{Magma}}
\newcommand{\bob}{\text{Bob}}
\newcommand{\true}{\text{T}}
\newcommand{\false}{\text{F}}
\newcommand{\ahat}{\hat{a}}
\newcommand{\ah}{\ahat}
\newcommand{\bhat}{\hat{b}}
\newcommand{\abar}{\bar{a}}
\newcommand{\cA}{\mathcal{A}}
\newcommand{\cF}{\mathcal{F}}
\newcommand{\cW}{\mathcal{W}}
\newcommand{\todo}[1]{{\color{red} TODO: #1}}
\renewcommand{\div}{\operatorname{div}}
\newcommand{\gexp}[3]{#1^{#2 #3}}
\newcommand{\gexpp}[3]{\displaystyle\left(#1\right)^{#2 #3}}
\newcommand{\glog}[3]{\log_{#1}^{#3}#2}
\def\dbend{{!!!}}
\newcommand{\lt}{<}
\newcommand{\gt}{>}
\newcommand{\amp}{&}
\definecolor{fillinmathshade}{gray}{0.9}
\newcommand{\fillinmath}[1]{\mathchoice{\colorbox{fillinmathshade}{$\displaystyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\textstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptscriptstyle\phantom{\,#1\,}$}}}
\)
Subsection 2.3.3 Floor and Ceiling
Definition 2.3.3.1 .
The
floor of a real number
\(x\text{,}\) denoted
\(\floor{x}\text{,}\) is the largest integer that is less than or equal to
\(x\text{.}\)
Example 2.3.3.2 . Floor.
The floor
\(\floor{2.7} = 2\text{,}\) since
\(2\) is the largest integer that is less than or equal to
\(2.7\text{.}\)
Example 2.3.3.4 . Floor of a negative number.
The floor
\(\floor{-2.7} = -3\text{,}\) since
\(-3\) is the largest integer that is less than or equal to
\(-2.7\text{.}\)
Example 2.3.3.5 . Floor of an integer.
The floor of an integer is the integer itself, so
\(\floor{3} = 3\text{,}\) \(\floor{-3} = -3\text{,}\) and
\(\floor{0} = 0\text{.}\)
Definition 2.3.3.6 .
The
ceiling of a real number
\(x\text{,}\) denoted
\(\ceiling{x}\) , is the smallest integer that is greater than or equal to
\(x\text{.}\)
Example 2.3.3.7 . Ceiling.
The ceiling
\(\ceiling{2.7} = 3\text{,}\) since
\(3\) is the smallest integer that is greater than or equal to
\(2.7\text{.}\)
Example 2.3.3.9 . Ceiling of a negative number.
The ceiling
\(\ceiling{-2.7} = -2\text{,}\) since
\(-2\) is the smallest integer that is greater than or equal to
\(-2.7\text{.}\)
Example 2.3.3.10 . Ceiling of an integer.
The ceiling of an integer is the integer itself, so
\(\ceiling{3} = 3\text{,}\) \(\ceiling{-3} = -3\text{,}\) and
\(\ceiling{0} = 0\text{.}\)