' Collection of code snippets by Arne Vajhøj 
' (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
Function mysqrt(x As Double) As Double
    Dim res As Double
    res = x / 3
    Do
        res = 0.5 * (res + x / res)
    Loop While Abs(res * res - x) > 0.0000001
    mysqrt = res
End Function

Function testmysqrt()
    MsgBox (Sqr(123.456) & " " & mysqrt(123.456))
End Function
