diff options
author | rsiddharth <s@ricketyspace.net> | 2018-09-09 03:24:45 +0000 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2018-09-09 03:24:45 +0000 |
commit | 0f3b6bcb7dc4425c08e91348978b521baf401b07 (patch) | |
tree | 88fe3af78ad4673fc0283d54aec4b574ef14312c /net/ricketyspace | |
parent | 4b565c15e47801a0b5389061514622c378916576 (diff) |
Add (net ricketyspace sicp two fourteen).
* net/ricketyspace/sicp/two/fourteen.scm: New file.
Diffstat (limited to 'net/ricketyspace')
-rw-r--r-- | net/ricketyspace/sicp/two/fourteen.scm | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/net/ricketyspace/sicp/two/fourteen.scm b/net/ricketyspace/sicp/two/fourteen.scm new file mode 100644 index 0000000..ea3e351 --- /dev/null +++ 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)) + |