Returns the smallest integer greater than or equal to the
specified double.
[Edit]
Parameters
- a
- A double .
[Edit]
Returns
A double containing the value of the smallest integer greater
than or equal to a. If a is equal to double.NaN, double.NegativeInfinity,
or double.PositiveInfinity
, that value
is returned.
[Edit]
Remarks
Example
The following example demonstrates using the Math.Ceiling(double) method.
C# Example |
using System;
public class MathCeilingExample
{
public static void Main()
{
Double d1 = Math.Ceiling(3.4);
Double d2 = Math.Ceiling(-3.4);
Console.WriteLine("Math.Ceiling(3.4) returns {0}", d1);
Console.WriteLine("Math.Ceiling(-3.4) returns {0}", d2);
}
}
|
The output is
Math.Ceiling(3.4) returns 4
Math.Ceiling(-3.4) returns -3
Requirements
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0