MathCeiling

, value, Math.Ceiling(value), Math.Floor(value));

Were sorry. The content you requested has been removed. Youll be auto redirected in 1 second.

SyntaxCC++FVBCopypublicstaticdoubleCeiling(doublea )aType:System.Double

[] values = 7.03, 7.64, 0.12, -0.12, -7.1, -7.6; Console.WriteLine(

A double-precision floating-point number.

// The example displays the following output to the console:

The following example illustrates theMath.Ceiling(Double)method and contrasts it with theFloor(Double)method.

Returns the smallest integral value that is greater than or equal to the specified double-precision floating-point number.

The behavior of this method follows IEEE Standard 754, section 4. This kind of rounding is sometimes called rounding toward positive infinity. In other words, ifais positive, the presence of any fractional component causesato be rounded to the next highest integer. Ifais negative, the rounding operation causes any fractional component ofato be discarded. The operation of this method differs from theFloor(Double)method, which supports rounding toward negative infinity.

Supported in:portable .NET platforms

This documentation is archived and is not being maintained.

This documentation is archived and is not being maintained.

The smallest integral value that is greater than or equal toa. Ifais equal toNaNNegativeInfinity, orPositiveInfinity, that value is returned. Note that this method returns aDoubleinstead of an integral type.

The API Reference documentation has a new home. Visit the.NET API Browseron to see the new experience.

MathCeiling

Leave a Reply