tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
17
Task/Nth-root/PicoLisp/nth-root.l
Normal file
17
Task/Nth-root/PicoLisp/nth-root.l
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
(load "@lib/math.l")
|
||||
|
||||
(de nthRoot (N A)
|
||||
(let (X1 A X2 (*/ A N))
|
||||
(until (= X1 X2)
|
||||
(setq
|
||||
X1 X2
|
||||
X2 (*/
|
||||
(+
|
||||
(* X1 (dec N))
|
||||
(*/ A 1.0 (pow X1 (* (dec N) 1.0))) )
|
||||
N ) ) )
|
||||
X2 ) )
|
||||
|
||||
(prinl (format (nthroot 2 2.0) *Scl))
|
||||
(prinl (format (nthroot 3 12.3) *Scl))
|
||||
(prinl (format (nthroot 4 45.6) *Scl))
|
||||
Loading…
Add table
Add a link
Reference in a new issue