Guest User

HtDP: Racket unit-testing framework example

a guest
Mar 26th, 2019
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Racket 0.21 KB | None | 0 0
  1. ; Number -> Number
  2. ; converts Fahrenheit temperatures to Celsius temperatures
  3.  
  4. (check-expect (f2c -40) -40)
  5. (check-expect (f2c 32) 0)
  6. (check-expect (f2c 212) 100)
  7.  
  8. (define (f2c f)
  9.   (* 5/9 (- f 32)))
Advertisement
Add Comment
Please, Sign In to add comment