Stream: beginners

Topic: ✔ Num.divTrunc and Num.divCeil name


view this post on Zulip Ryan Bates (Dec 10 2023 at 15:08):

I recently discovered Num.divTrunc and Num.divCeil which are quite useful functions. I think I would have discovered them sooner if the names were more consistent with the other functions.

view this post on Zulip Richard Feldman (Dec 10 2023 at 15:51):

it's trunc instead of floor because it truncates everything after the decimal point rather than flooring (truncating 1.2 and -1.2 gives 1 and -1, but flooring them gives 1 and -2)

view this post on Zulip Richard Feldman (Dec 10 2023 at 15:52):

I could see an argument for renaming it to Num.ceil :thumbs_up:

view this post on Zulip Ryan Bates (Dec 10 2023 at 20:01):

Thanks for the clarification. It makes more sense now.

view this post on Zulip Notification Bot (Dec 10 2023 at 20:01):

Ryan Bates has marked this topic as resolved.


Last updated: Jul 06 2025 at 12:14 UTC