...

/

Challenge: Find the Floor and Ceil of a Number in a Sorted Array

Challenge: Find the Floor and Ceil of a Number in a Sorted Array

Find the floor and ceiling of a number from a sorted pool of numbers.

Floor functions

A floor function takes a real number xx and returns the greatest integer less than or equal to xx.

For example:

floor(x)=xfloor(x) = \lfloor x \rfloor ...