Skip to content

Instantly share code, notes, and snippets.

@yao2030
Created December 6, 2012 02:03
Show Gist options
  • Save yao2030/4221279 to your computer and use it in GitHub Desktop.
Save yao2030/4221279 to your computer and use it in GitHub Desktop.
(define (pi n)
(define (p-term x)
(if (even? x)
(/ x (- x 1))
(/ (- x 1) x)))
(define (p-next x)
(+ x 1))
(* 4.0 (product p-term 3 p-next n)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment