C# Math Ceiling(Double)
Description
Math Ceiling(Double)
returns the smallest integral
value that is greater than or equal to the specified double-precision floating-point
number.
Syntax
Math.Ceiling(Double)
has the following syntax.
public static double Ceiling(
double a
)
Parameters
Math.Ceiling(Double)
has the following parameters.
a
- A double-precision floating-point number.
Returns
Math.Ceiling(Double)
method returns The smallest integral value that is greater than or equal to a. If a is equal
to NaN, NegativeInfinity, or PositiveInfinity, that value is returned.
Note that this method returns a Double instead of an integral type.
Example
The following example illustrates the Math.Ceiling(Double) method.
using System;/*from ww w . j a va 2s . c o m*/
public class MainClass{
public static void Main(String[] argv){
Console.WriteLine(Math.Ceiling(1.2));
}
}
The code above generates the following result.