Math.ceiling Function in VB.NET

What is the use of math.ceiling() in VB.NET?


Math.Ceiling Function

Math.Ceiling() Mathematical Function in Visual 2008 is used to return an integer greater than or equal to the specified number.


In the above syntax Number specifies the number to find the ceiled value.

Module Module1
Sub Main()
Console.WriteLine("Ceiled value of 1.15 is: "
& Math.Ceiling(1.15))
Console.WriteLine("Ceiled value of 0.15 is: "
& Math.Ceiling(0.15))
Console.WriteLine("Ceiled value of 1.00 is: "
& Math.Ceiling(1))
End Sub
End Module

Ceiled value of 1.15 is: 2
Ceiled value of 0.15 is: 1
Ceiled value of 1.00 is: 1

In the above example, the decimal values are ceiled to next higher integer, and the integer '1' is ceiled to '1'.

Visual Basic Tutorial

Ask Questions

Ask Question