Round up?

I thought there was a “round up” function in mathf, but I can’t find it.
What’s the most efficient way to round up a decimal value?

Or to be more specific, I’m trying to divide a value but I want the result rounded up.
So if I have 16 divided by 8, I would get 2,
but if I have 17 divided by 8, I would get 3.
I thought I was able to cast the result to an int, but this actually trunkates the value, so (int)(23f / 8) is returning 3 instead of 4.

But the only round functions I see within mathf are round and roundToInt, both of which roll up or down to the closest value. Not what I’m looking for.

1 Like
1 Like

Ahhhh! I knew there was a function in there! When I was reading the descriptions that one sounded more like a comparison thing, like min.

Thank you!