# Calculus Functions: Floor and Ceiling Functions --- The **floor** and **ceiling** functions are functions that both round to the nearest integer. The difference is clear in their name. * The **floor** function rounds the number **down** to the nearest integer. * The **ceiling** function rounds the number **up** to the nearest integer. We use the notation $\left\lfloor x \right\rfloor$ for the floor of $x$, and $\left\lceil x \right\rceil$ for the ceiling of $x$. Look at the difference between the two symbols careflly. ## "Always round x down": $\left\lfloor x \right\rfloor$ : <span style = "color:red"> "floor of x" </span> ## "Always round x up": $\left\lceil x \right\rceil$ : <span style = "color:red"> "ceiling of x" </span> Here is a video that explains how the **floor** function works: <iframe width="560" height="315" src="https://www.youtube.com/embed/Ug-33FXgt24" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> ## Some Examples For Practice **Calculate Each of the Following** a. $\left\lfloor 2.1 \right\rfloor$ b. $\left\lfloor 2.999 \right\rfloor$ c. $\lfloor \pi \rfloor$ d. $\lfloor 10^{10} + 0.0001 \rfloor$ e. $\lceil \pi - 1 \rceil$ **Answers:** a. $\lfloor 2.1 \rfloor = 2$ b. $\lfloor 2.9999 \rfloor = 2$ c. $\lfloor \pi \rfloor = 3$ d. $\lfloor 10^{10} + 0.0001 \rfloor = 10^{10}$ e. $\lceil \pi - 1 \rceil = 2$ ## Practical Application A table describing the cost of a first-class letter weighing $x$ ounces is given below. ![](https://i.imgur.com/tHQcG9p.png) **Source:** https://www.stamps.com/usps/postage-rate-increase/ A business that mails lots of postage will need to allocate a budget for mailing letters. **Problem:** Come up with a mathematical formula for the cost of mailing a first class letter weighing $x$ oz in 2021. At first glance, we might be tempted to think this function is *linear* with a slope of 0.20, but it isn't. **You Try It:** The video below shows excerpts from a class where students worked together to solve the problem of finding a formula that represents the postage price given above. **Before watching the video, please spend some time thinking about what formula you might use to represent the information above.** <iframe width="560" height="315" src="https://www.youtube.com/embed/wnYh1-FEW_o" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> However, notice that there is a way to use floor functions here! **Idea:** We could also represent the postage price function from 0 to 3.5 oz as: $P(x) = 0.2 \lfloor x - 1 \rfloor + 0.53H(x)$, where $H(x)$ represents the [Heaviside step function](https://en.wikipedia.org/wiki/Heaviside_step_function) **Reality Testing:** Make a [reality testing table]() of some $x$-values between 0 and 3 that you could evaluate as a weight for a letter. Remember to include decimal values as well as integers. For each value, test that the function value agrees with the real-world value.