>>7
That's the canonical portable implementation. There are also CPU architecture specific implementations in the corresponding directories in the glibc/eglibc source package.
OP, I suggest you read the following:
http://floating-point-gui.de/
Most CPU's have different instructions for setting the rounding and denormal modes of the FPU. Modern x86-64 CPUs have deprecated the FPU in favor of SSE and AVX and have individual instructions for rounding scalar and vector numbers in different fashions, without need to set rounding mode state.
So, ceil, floor, round, rint, etc. all distill down to one or two instructions each.