VOOZH about

URL: https://www.geeksforgeeks.org/c-sharp/decimal-ceiling-method-in-c-sharp/

⇱ Decimal.Ceiling() Method in C# - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Decimal.Ceiling() Method in C#

Last Updated : 29 Jan, 2019
This method is used to round the decimal to the closest integer toward positive infinity.
Syntax: public static decimal Ceiling (decimal d); Here d is the decimal whose ceiling value is to be calculated. Return Value: It returns the smallest integral value that is greater than or equal to the d parameter. Note that this method returns a Decimal instead of an integral type.
Below programs illustrate the use of Decimal.Ceiling(Decimal) Method: Example 1:
Output:
Ceiling Value is : 5
Example 2:
Output:
Ceiling Value is : -5
Example 3:
Output:
Ceiling Value is : 2
Comment
Article Tags:

Explore