SICP Exercises in F#, Section 1.1.1

> 486;;
val it : int = 486
> 137 + 349;;
val it : int = 486
> 1000 - 334;;
val it : int = 666
> 5 * 99;;
val it : int = 495
> 10 / 5;;
val it : int = 2
> 2.7 + 10;;

  2.7 + 10;;
  ------^^^

stdin(11,7): error FS0001: The type 'int' does not match the type 'float'.
> 2.7 + (float)10;;
val it : float = 12.7
> 21 + 35 + 12 + 7;;
val it : int = 75
> 25 * 4 * 12;;
val it : int = 1200
> (3 * 5) + (10 - 6);;
val it : int = 19
> (3 * ((2 * 4) + (3 + 5)) + ((10 - 7) + 6);;

  (3 * ((2 * 4) + (3 + 5)) + ((10 - 7) + 6);;
  -----------------------------------------^^^

stdin(16,42): error FS0010: Unexpected symbol ';;' in expression. Expected ')' or other token
> (3 * ((2 * 4) + (3 + 5))) + ((10 - 7) + 6);;
val it : int = 57
Advertisements

0 Responses to “SICP Exercises in F#, Section 1.1.1”



  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: