Questions: Ceiling and Floor Functions

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

What is ⌊−2.7⌋?

A−2
B−3
C2
D3
Question 2 Multiple Choice

A computer must divide an array of 15 elements into groups of 4 for parallel processing. If there are leftover elements, they still need a group. How many groups are required?

A3, because ⌊15/4⌋ = 3
B4, because ⌈15/4⌉ = 4
C3.75, because 15 ÷ 4 = 3.75
D4, because you always round up in computer science
Question 3 True / False

For any real number x, ⌊x⌋ generally rounds x toward zero.

TTrue
FFalse
Question 4 True / False

If x is not an integer, then ⌈x⌉ = ⌊x⌋ + 1.

TTrue
FFalse
Question 5 Short Answer

You need to find how many complete weeks fit in a 100-day period, and separately, how many weeks are needed to fully contain a 100-day period (i.e., no day is left uncovered). Express both answers using floor and ceiling functions and explain the difference.

Think about your answer, then reveal below.