Question: I don't understand the casting rules when it comes to decimal and double.

It is legal to do this

```
decimal dec = 10;
double doub = (double) dec;

```

What confuses me however is that decimal is a 16 byte datatype and double is 8 bytes so isn't casting a double to a decimal a widening conversation and should therefore be allowed implicitly; with the example above disallowed?

```
double doub = 3.2;
decimal dec = doub; // CS0029: Cannot implicitly convert type 'double' to 'decimal'

```

Answer: 
Decimal is more precise, so you would lose information. That's why you can only do it explicitely. It's to protect you from losing information. See MSDN

<http://msdn.microsoft.com/en-us/library/678hzkk9%28v=VS.100%29.aspx>

<http://msdn.microsoft.com/en-us/library/364x0z75.aspx>
You can explicitly cast in both directions: from `double` to `decimal` and from `decimal` to `double`.

You can't implicitly convert in either direction for a very good reason: the conversion may not be loss-less. 

For example, the decimal number 1234567890123456789 can not be exactly represented as a double. Likewise, the double number `10^32` cannot be exactly represented as a decimal number.

To avoid losing information unintentionally, the implicit conversion is disallowed.