Corrected the implementation of ceil and floor.

Thanks to Bruce Dawson.