Add floor function from contributor

@Hendekagon sent this PR to my fork. I merged it speculatively and said I'd send it on as a PR. I can't remember whether there's already similar functionality in the library, but it seems a useful idea.