daily pastebin goal
56%
SHARE
TWEET

Untitled

a guest Apr 16th, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (define (cubert x)
  2.   (define (improve guess x)
  3.     (/
  4.      (+ (/ x (* guess guess)) (* 2 guess))
  5.      3)
  6.     )
  7.  
  8.   (define (cube x)
  9.     (* x x x))
  10.     (define (good-enough? guess x)
  11.     (< (abs (- (cube guess) x)) 0.001))
  12.   (define (cube-iter guess x)
  13.     (if (good-enough? guess x)
  14.         guess
  15.         (cube-iter (improve guess x) x)))
  16.   (cube-iter 1.0 x)
  17.   )
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top