Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
19
Task/Pi/Racket/pi-1.rkt
Normal file
19
Task/Pi/Racket/pi-1.rkt
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#lang racket
|
||||
(require racket/generator)
|
||||
|
||||
(define pidig
|
||||
(generator ()
|
||||
(let loop ([q 1] [r 0] [t 1] [k 1] [n 3] [l 3])
|
||||
(if (< (- (+ r (* 4 q)) t) (* n t))
|
||||
(begin (yield n)
|
||||
(loop (* q 10) (* 10 (- r (* n t))) t k
|
||||
(- (quotient (* 10 (+ (* 3 q) r)) t) (* 10 n))
|
||||
l))
|
||||
(loop (* q k) (* (+ (* 2 q) r) l) (* t l) (+ 1 k)
|
||||
(quotient (+ (* (+ 2 (* 7 k)) q) (* r l)) (* t l))
|
||||
(+ l 2))))))
|
||||
|
||||
(for ([i (in-naturals)])
|
||||
(display (pidig))
|
||||
(when (zero? i) (display "." ))
|
||||
(when (zero? (modulo i 80)) (newline)))
|
||||
1
Task/Pi/Racket/pi-2.rkt
Normal file
1
Task/Pi/Racket/pi-2.rkt
Normal file
|
|
@ -0,0 +1 @@
|
|||
3.14159265358979323846264338327950288419716939937510...
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
#lang racket
|
||||
(require math/bigfloat)
|
||||
(bf-precision (exact-floor (/ (* 200 (log 10)) (log 2))))
|
||||
pi.bf
|
||||
Loading…
Add table
Add a link
Reference in a new issue