Math.Floor Function in VB.NET

What is the use of math.floor() mathematical function in VB.NET


Math.Floor Mathematical Function

Math.Floor() Mathematical Function in 2008 is used to return largest integer less than or equal to the specified number.


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

Module Module1
Sub Main()
Console.WriteLine("Floor value of 1.23 is:
" & Math.Floor(1.23))
Console.WriteLine("Floor value of 1.99 is:
" & Math.Floor(1.99))
Console.WriteLine("Floor value of 2 is:
" & Math.Floor(2))
End Sub
End Module

Floor value of 1.23 is: 1
Floor value of 1.99 is: 1
Floor value of 2 is: 2

In the above example all decimals have the floor values that are the largest integer lesser than the given number. But '2' has the floor value equal to '2'.

Visual Basic Tutorial

Ask Questions

Ask Question