Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
11
Task/Nth-root/BASIC/nth-root-1.basic
Normal file
11
Task/Nth-root/BASIC/nth-root-1.basic
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
FUNCTION RootX (tBase AS DOUBLE, tExp AS DOUBLE, diffLimit AS DOUBLE) AS DOUBLE
|
||||
DIM tmp1 AS DOUBLE, tmp2 AS DOUBLE
|
||||
' Initial guess:
|
||||
tmp1 = tBase / tExp
|
||||
DO
|
||||
tmp2 = tmp1
|
||||
' 1# tells compiler that "1" is a double, not an integer
|
||||
tmp1 = (((tExp - 1#) * tmp2) + (tBase / (tmp2 ^ (tExp - 1#)))) / tExp
|
||||
LOOP WHILE (ABS(tmp1 - tmp2) > diffLimit)
|
||||
RootX = tmp1
|
||||
END FUNCTION
|
||||
Loading…
Add table
Add a link
Reference in a new issue