As explained here, Math.Ceiling returns: “The smallest integral value that is greater than or equal to a”. But later it says: “Note that this method returns a Double type instead of an integral type.” I’m just wondering why?
As explained here , Math.Ceiling returns: The smallest integral value that is greater than
Share
Because a double has a much bigger maximum value than an integer supports.
Asking for the ceiling on a
doublethat has a value greater thanInt32.MaxValue(or evenInt64.MaxValue) would not be possible if it returned an integer.