tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
11
Task/Nth-root/Forth/nth-root.fth
Normal file
11
Task/Nth-root/Forth/nth-root.fth
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
: th-root { F: a F: n -- a^1/n }
|
||||
a
|
||||
begin
|
||||
a fover n 1e f- f** f/
|
||||
fover n 1e f- f*
|
||||
f+ n f/
|
||||
fswap fover 1e-5 f~
|
||||
until ;
|
||||
|
||||
34e 5e th-root f. \ 2.02439745849989
|
||||
34e 5e 1/f f** f. \ 2.02439745849989
|
||||
Loading…
Add table
Add a link
Reference in a new issue