Newton had a fun way to approximate general roots...
#21
Ok, I didn't understand almost anything, but what the heck.

In case anyone is interested: A function that can be used to calculate the n-te root from a basis. Certainly still room for improvement when it comes to larger numbers, in terms of clean formatting.

Code: (Select All)
'N-te Wurzel berechnen - 15. Sept. 2022
'sqrtn(x, n) = x ^ (1 / n)

Option _Explicit

Declare Function Nte_Wurzel(n As Double, x As Double) As Double

Dim As Double n, x

Print
Input "Wurzelexponent: ", n
Input "Radikand      : ", x

Print
Print Using "Die ##.# Wurzel aus ###.# ist: ##.###"; n, x, Nte_Wurzel(n, x)

End

Function Nte_Wurzel (n As Double, x As Double)

  Dim wurzelx As Double

  wurzelx = x ^ (1 / n)
  Nte_Wurzel = wurzelx
End Function

[Image: n-te-Wurzel2022-09-15.jpg]
Reply


Messages In This Thread
RE: Newton had a fun way to approximate general roots... - by Kernelpanic - 09-15-2022, 08:23 PM



Users browsing this thread: 5 Guest(s)