Math.Ceiling returns double because double may store much bigger numbers.
However if i’m sure that int type is capable to store the result how should I convert? Is it safe to cast (int) Math.Ceiling(... ?
Math.Ceiling returns double because double may store much bigger numbers. However if i’m sure
Share
If you are sure that you do not cross the capacity of int, it should be perfectly safe to do
If you are not sure about the bound, you could go with
longinstead ofint.