Advertisement
5_2007-2008 Math/ Dates #178584

Square root without sqr

The code is simply shows you how to evaluate square root without using sqr function. It may not really be usefull but if you interested it'll be of some value to you.By the way, i was surprised when after search for simmilar function only found examples of using Sqr(x)

AI

ملخص الذكاء الاصطناعي: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

كود المصدر
original-source
Function sqroot(number As Integer) As Single
res = number / 2
Do
summed = (number - res * res) / (2 * res)
res = res + summed
Loop Until summed > -0.0001 And summed < 0.0001
Text2.Text = res
End Function
Private Sub Command1_Click()
sqroot (Int(Text1.Text))
End Sub
التعليقات الأصلية (3)
مسترجع من Wayback Machine