Floor and ceiling are two functions.
The floor function, R→Z
, maps a real number, x
, to the greatest integer that is less than or equal to x
.
This is written ⌊x⌋
.
The ceiling function, R→Z
, maps a real number, x
, to the least integer that is greater than or equal to x
.
This is written ⌈x⌉
.
⌈99.9⌉=100
⌊99.9⌋=99
⌈-99.9⌉=-99
⌊-99.9⌋=-100
T. H. Cormen, C. E. Leiserson, R. L. Rivest, Introduction to Algorithms. MIT Press, 1990.
Copyright © 2014 Barry Watson. All rights reserved.