CodeItBetter Programming Another VB Programming Blog

How to find Square root of a given number

Posted on January 4, 2009
1
2
3
4
5
6
7
8
9
10
11
'Math - How to find Square root of a given number
Public Function dblSqrt(ByVal dblParameter As Double) As Double
    'Check if the input parameter is negative
    If dblParameter < 0 Then
        'If the input parameter is negative, return -1
        dblSqrt = -1
    Else
        'If the input parameter is positive, return its square root
        dblSqrt = Sqr(dblParameter)
    End If
End Function
Filed under: Math Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.