|
|
||
|
|
Start of topic | Skip to actions
Solution: hypotenuse; square : number -> number ; Returns the square of the input. (define (square n) (* n n)) 'square_examples (= (square 0) 0) (= (square 2) 4) (= (square 3) 9) (= (square 5) 25) ; hypotenuse : real real -> positive-real ; Returns the length of the hypotenuse of a right triangle having ; the given height and width. (define (hypotenuse height width) (sqrt (+ (square height) (square width)))) 'hypotenuse_examples (= (hypotenuse 0 0) 0) (= (hypotenuse 3 4) 5) (= (hypotenuse 6 8) 10) Access Permissions
Topic Actions: Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r3 < r2 < r1 | More topic actions
Webs: Main | TWiki | Africa | EmbeddedSystems | Gpce | Houston | International | K12 | MetaOCaml | MulticoreOCR | ProgrammingLanguages | RAP | RIDL | Sandbox | SpeechClub | Teaching | Texbot | WG211 Web Actions: |
|
This work is licensed under a Creative Commons Attribution 2.5 License. Please follow our citation guidelines.