SICP Exercises in F#, Exercise 1.3

> let proc3 a b c =
 let sqr x = x * x
 let sum_of_squares m n = sqr m + sqr n
 let biggest m n = if m > n then m else n
 let smallest m n = if m > n then n else m
 sum_of_squares (biggest a b) (biggest (smallest a b) c);;

val proc3 : int -> int -> int -> int

> proc3 2 3 4;;
val it : int = 25
Advertisements

0 Responses to “SICP Exercises in F#, Exercise 1.3”



  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s





%d bloggers like this: