In mathematics and computer science, the floor and ceiling functions map a real number to the largest previous or the smallest following integer, respectively. More precisely, floor(x) = is the largest integer less than or equal to x and ceiling(x) = is the smallest integer greater than or equal to x.