Newton had a fun way to approximate general roots...
#2
Cool, I think I figured it out. Just applied a couple of tweaks to the above, and...

Code: (Select All)
DIM AS DOUBLE a, n, root
DO
    a = 1
    INPUT "Number: "; n
    INPUT "Root:   "; root
    DO
        olda = a
        a = a - ((a) ^ root - n) / (root * a ^ (root - 1))
        PRINT a
    LOOP UNTIL olda = a
LOOP

Pete
If eggs are brain food, Biden takes his scrambled.
Reply


Messages In This Thread
RE: Newton had a fun way to approximate square roots... - by Pete - 09-13-2022, 03:40 AM



Users browsing this thread: 11 Guest(s)