Question:

Floor functions?

Floor functions?

Answer:

Remember x can describe as integer part y and decimal part .ddddd or y.dddd the floor of y.dddd and -y.dddddd so floor of (y.dddd) is y (the next smaller number ) the floor of (-y.ddddd) = -y - 1 (the next smaller number) so along as .dddd is not zero . for positive x , floor(y.ddddd) = y for negative x, floor(-y.dddd) = -y - 1 so floor(x) + floor(-x) = y + (-y -1) = -1 However , when x is a whole number you have y + (-y) = 0

Share to: