;; The first three lines of this file were inserted by DrRacket. They record metadata ;; about the language level of this file in a form that our tools can easily process. #reader(lib "htdp-beginner-reader.ss" "lang")((modname 7.7.1) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ()))) ; Exercise 7.7.1 (define bignum 1234567890) ; cube : number -> number (check-expect (cube 0) 0) (check-expect (cube 2) 8) (check-expect (cube -3) -27) (check-expect (cube 2/3) 8/27) (check-within (cube (sqrt 2)) 2.828 .01) (define (cube num) ; num number 2/3 ; should be number 8/27 (* num num num) ) (cube 19) "should be a little under 8000" (cube bignum) "should be 28-29 digits long" ; Note that "check-expect" and "check-within" test cases can appear either before or after the definition, ; while "should be" test cases don't work if they're before the definition.