sicp

sicp sandbox.
git clone git://git.ricketyspace.net/sicp.git
Log | Files | Refs

commit 0f3b6bcb7dc4425c08e91348978b521baf401b07
parent 4b565c15e47801a0b5389061514622c378916576
Author: rsiddharth <s@ricketyspace.net>
Date:   Sun,  9 Sep 2018 03:24:45 +0000

Add (net ricketyspace sicp two fourteen).

* net/ricketyspace/sicp/two/fourteen.scm: New file.

Diffstat:
net/ricketyspace/sicp/two/fourteen.scm | 27+++++++++++++++++++++++++++
1 file changed, 27 insertions(+), 0 deletions(-)

diff --git a/net/ricketyspace/sicp/two/fourteen.scm b/net/ricketyspace/sicp/two/fourteen.scm @@ -0,0 +1,27 @@ +;;;; Under Creative Commons Attribution-ShareAlike 4.0 +;;;; International. See +;;;; <https://creativecommons.org/licenses/by-sa/4.0/>. + +(define-module (net ricketyspace sicp two fourteen) + #:use-module (net ricketyspace sicp two seven) + #:use-module (net ricketyspace sicp two ten) + #:use-module (net ricketyspace sicp two twelve) + #:export (par1 par2 R1 R2 R3 A B)) + +(define (par1 r1 r2) + (div-interval (mul-interval r1 r2) + (add-interval r1 r2))) + +(define (par2 r1 r2) + (let ((one (make-interval 1 1))) + (div-interval one + (add-interval (div-interval one r1) + (div-interval one r2))))) + +(define R1 (make-interval 4 5)) +(define R2 (make-interval 7 8)) +(define R3 (make-interval 1 1)) + +(define A (make-center-percent 6 0.5)) +(define B (make-center-percent 2 1)) +