Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 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
|
||||
1
Task/Nth-root/BASIC/nth-root-2.basic
Normal file
1
Task/Nth-root/BASIC/nth-root-2.basic
Normal file
|
|
@ -0,0 +1 @@
|
|||
FUNCTION RootX# (tBase AS DOUBLE, tExp AS DOUBLE, diffLimit AS DOUBLE)
|
||||
1
Task/Nth-root/BASIC/nth-root-3.basic
Normal file
1
Task/Nth-root/BASIC/nth-root-3.basic
Normal file
|
|
@ -0,0 +1 @@
|
|||
PRINT "The "; e; "th root of "; b; " is "; RootX(b, e, .000001)
|
||||
Loading…
Add table
Add a link
Reference in a new issue