Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

Possibly Related Threads…
Thread Author Replies Views Last Post
  "I'm Having Fun." James D Jarvis 6 1,314 07-25-2023, 11:32 PM
Last Post: Kernelpanic
  New General Discussion Subforums admin 13 4,738 02-14-2023, 08:21 AM
Last Post: PhilOfPerth
  Fun with hardware acceleration. Pete 0 478 10-20-2022, 10:25 PM
Last Post: Pete
  Roots and powers playing nicely together... Pete 28 5,113 10-01-2022, 10:16 PM
Last Post: Kernelpanic
  Pascal's Triangle and nth roots. Pete 2 885 09-26-2022, 04:15 PM
Last Post: Pete

Forum Jump:


Users browsing this thread: 1 Guest(s)