Using Advanced Mathematical Functions in VB.NET


More advanced mathematical functions in VB.NET utilizes the System.Math class. This class supports a wide variety of in-built functions such as :

Constants like E and Pi
Trigonometric functions like Sin, Cos & Tan
Logarithmic functions like Log & Log10
and other functions like Ceiling, Floor, Max, Min, Pow, Exp, Sqrt, Abs, Round etc.


The example below shows how some of these advanced mathematical functions are used.


Dim i, j, k as Integer


i = Math.Sqrt(25)
j = Math.Pow(2,5)
k = Math.Abs(-25)


Msgbox(i) '--- result has a value of 5
Msgbox(j) '--- result has a value of 32
Msgbox(k) '--- result has a value of 25


See also Simple Mathematical Functions

0 comments