# Ceil () and Floor()

I already know the basic rules for the both functions:

$$\text{Ceil}(2.5)=3\\ \text{Floor}(2.5)=2$$

But I could not understand the following these:

$$\text{Ceil}(2.6, 0.25)=2.75\\ \text{Floor}(2.6, 0.25)=2.5$$

Why is there a second parameter? How Could I calculate the that to obtain the results above?

PS: I already been researching on google and books, but I only could get what I already know.

• It looks like the second parameter signifies the increments to which you're supposed to round to. For example, in Floor(2.6,0.25), you round 2.6 down to the nearest multiple of 0.25, which is 2.5. Another example: Floor($\pi$, 0.1) would be 3.1, because this is the nearest multiple of 0.1 to $\pi$. – Shalop Apr 26 '15 at 0:27
• Where did you get this from? It seems you are talking about the Ceil and Floor functions of some programing language, and in that case which programming language you are talking about certainly seems to be a significant piece of information useful for anyone who is trying to help you... Then again, you may be not talking about a programming language at all. Who knows! :-) – Mariano Suárez-Álvarez Apr 26 '15 at 0:30
• You need to ask about that particular computer language... You are writing come computer language $Floor(2.6)$ and not mathematics $\lfloor 2.6 \rfloor$. So consult the manual for that language. – GEdgar Apr 26 '15 at 0:36
These are to the nearest multiple of $0.25$, rather than integer (multiple of $1$).
From the two examples you have, one possible interpretation is $$\text{Floor(a,b) = Largest x \leq a such that x=nb, where n \in \mathbb{Z}}$$ $$\text{Ceil(a,b) = Smallest x \geq a such that x=nb, where n \in \mathbb{Z}}$$ The usual floor and ceil function are $$\text{Floor(a) = Floor(a,1)}$$ $$\text{Ceil(a) = Ceil(a,1)}$$