Math.Ceiling returns the smallest integral that is greater than or equal to the decimal number. : Math Function « Development « VB.Net






Math.Ceiling returns the smallest integral that is greater than or equal to the decimal number.

 
Imports System

Class Sample
   Public Shared Sub Main()
        Dim values() As Decimal = {-0.12d, -7.1d, -7.6d}
        Console.WriteLine("  Value          Ceiling          Floor")
        Console.WriteLine()
        For Each value As Decimal In values
           Console.WriteLine("{0,7} {1,16} {2,14}", _
                             value, Math.Ceiling(value), Math.Floor(value))
        Next   
   End Sub
End Class 

   
  








Related examples in the same category

1.Math: square root Math: square root
2.To the PowerTo the Power
3.Power ^ in VB.netPower ^ in VB.net
4.Calculating compound interestCalculating compound interest
5.Math.Max DemoMath.Max Demo
6.Rnd DemoRnd Demo
7.Square Root in Math packageSquare Root in Math package
8.Round in MathRound in Math
9.Sign in MathSign in Math
10.Atan and TanAtan and Tan
11.Asin and SinAsin and Sin
12.Acos and CosAcos and Cos
13.Power in VBPower in VB
14.Math class: Square root, absolute value, Pi and PowerMath class: Square root, absolute value, Pi and Power
15.Math: Min, Max, Exp, Ceil, Round and Log10Math: Min, Max, Exp, Ceil, Round and Log10
16.Math.Abs Method returns the absolute value of a Decimal number.
17.Math.Atan returns the angle whose tangent is the specified number.
18.Math.BigMul produces the full product of two 32-bit numbers.
19.Math.Cos returns the cosine of the specified angle.
20.Math.Cosh returns the hyperbolic cosine of the specified angle.
21.Math.DivRem calculates the quotient and returns the remainder in an output parameter.
22.Math.DivRem calculates the quotient of two integers and returns the remainder in an output parameter.
23.Math.E Field represents the natural logarithmic base, specified by the constant, e.
24.Math.Exp returns e raised to the specified power.
25.Math.IEEERemainder returns the remainder resulting from the division
26.Math.Log returns the natural (base e) logarithm of a specified number.
27.Math.Log returns the logarithm of a specified number in a specified base.
28.Math.Log10 returns the base 10 logarithm of a specified number.
29.Math.Max returns the larger of two 8-bit unsigned integers.
30.Math.Min returns the smaller of two 8-bit unsigned integers.
31.Math.Pow returns a specified number raised to the specified power.
32.Math.Round rounds a decimal value to the nearest integral value.
33.Math.Round rounds a decimal value to a specified number of fractional digits.
34.Math.Round rounds a decimal to a specified number of fractional digits.
35.Math.Round (Double) rounds a double-precision floating-point value to the nearest integral value.
36.Rounds a double-precision floating-point value to a specified number of fractional digits.
37.Rounds a double-precision floating-point value to the specified number of fractional digits
38.Math.Sign returns a value indicating the sign of a decimal number.
39.Math.Tanh Returns the hyperbolic tangent of the specified angle.
40.Math.Truncate Calculates the integral part of a specified decimal number.