| ------ | ------ | -------------------------- | --------------------------- |
| sbyte | 8 bit | -128 | +127 |
| short | 16 bit | -32_768 | +32_767 |
| int | 32 bit | -2_147_483_648 | +2_147_483_647 |
| long | 64 bit | -9_223_372_036_854_775_808 | +9_223_372_036_854_775_807 |
| byte | 8 bit | 0 | +255 |
| ushort | 16 bit | 0 | +65_535 |
| uint | 32 bit | 0 | +4_294_967_295 |
| ulong | 64 bit | 0 | +18_446_744_073_709_551_615 |
A variable (or expression) of one type can easily be converted to another. For instance, in an assignment operation, if the type of the value being assigned (lhs) ensures that the value will lie within the range of the type being assigned to (rhs) then there is a simple assignment:
```csharp
uint ui = uint.MaxValue;
ulong ul = ui; // no problem
```
On the other hand if the range of type being assigned from is not a subset of the assignee's range of values then a cast, `()` operation is required even if the particular value is within the assignee's range:
```csharp
short s = 42;
lhs
and rhs
were not introduced before being used on this line. That was a distraction for me when reading the documentation. Saying left-handed side (LHS) and right-handed side (RHS) might provide some clarity.
3 Likes
Good point. That exercise is awful.