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.