Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
12
Task/Nth-root/Factor/nth-root.factor
Normal file
12
Task/Nth-root/Factor/nth-root.factor
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
USING: kernel locals math math.functions prettyprint ;
|
||||
|
||||
:: th-root ( a n -- a^1/n )
|
||||
a [
|
||||
a over n 1 - ^ /f
|
||||
over n 1 - *
|
||||
+ n /f
|
||||
swap over 1e-5 ~ not
|
||||
] loop ;
|
||||
|
||||
34 5 th-root . ! 2.024397458499888
|
||||
34 5 recip ^ . ! 2.024397458499888
|
||||
Loading…
Add table
Add a link
Reference in a new issue