C# Math Ceiling(Decimal)
Description
Math Ceiling(Decimal)
returns the smallest integral
value that is greater than or equal to the specified decimal number.
Syntax
Math.Ceiling(Decimal)
has the following syntax.
public static decimal Ceiling(
decimal d
)
Parameters
Math.Ceiling(Decimal)
has the following parameters.
d
- A decimal number.
Returns
Math.Ceiling(Decimal)
method returns The smallest integral value that is greater than or equal to d. Note that this
method returns a Decimal instead of an integral type.
Example
The following example illustrates the Math.Ceiling(Decimal) method and contrasts it with the Floor(Decimal) method.
using System;//w w w . j ava 2 s .c o m
public class MainClass{
public static void Main(String[] argv){
Console.WriteLine(Math.Ceiling(1.2M));
}
}
The code above generates the following result.