Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
34
Task/Continued-fraction/PicoLisp/continued-fraction.l
Normal file
34
Task/Continued-fraction/PicoLisp/continued-fraction.l
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
(scl 49)
|
||||
(de fsqrt2 (N A)
|
||||
(default A 1)
|
||||
(cond
|
||||
((> A (inc N)) 2)
|
||||
(T
|
||||
(+
|
||||
(if (=1 A) 1.0 2.0)
|
||||
(*/ `(* 1.0 1.0) (fsqrt2 N (inc A))) ) ) ) )
|
||||
(de pi (N A)
|
||||
(default A 1)
|
||||
(cond
|
||||
((> A (inc N)) 6.0)
|
||||
(T
|
||||
(+
|
||||
(if (=1 A) 3.0 6.0)
|
||||
(*/
|
||||
(* (** (dec (* 2 A)) 2) 1.0)
|
||||
1.0
|
||||
(pi N (inc A)) ) ) ) ) )
|
||||
(de napier (N A)
|
||||
(default A 0)
|
||||
(cond
|
||||
((> A N) (* A 1.0))
|
||||
(T
|
||||
(+
|
||||
(if (=0 A) 2.0 (* A 1.0))
|
||||
(*/
|
||||
(if (> 1 A) 1.0 (* A 1.0))
|
||||
1.0
|
||||
(napier N (inc A)) ) ) ) ) )
|
||||
(prinl (format (fsqrt2 200) *Scl))
|
||||
(prinl (format (napier 200) *Scl))
|
||||
(prinl (format (pi 200) *Scl))
|
||||
Loading…
Add table
Add a link
Reference in a new issue