elixir-lang/elixir — pull request #1924 by bitwalker (2013-12-12 18:48:12+00:00)
Title: Add floor and ceil functions to Float

Let me know if you spot anything wrong with this, I think the tests are fairly comprehensive, but if you can think of any edge cases I may have missed, I'll certainly add tests for them.

Right now this will take either an integer or a float, truncate it as part of the floor/ceil operation, then convert it back to a float. The result of calling Float.floor or Float.ceil will always be a float this way. I think that makes more sense than returning an integer, but let me know if that's an incorrect assumption.