6.1.2 Implicit numeric conversions
Visual Studio .NET 2003
The implicit numeric conversions are:
- From
sbytetoshort,int,long,float,double, ordecimal. - From
bytetoshort,ushort,int,uint,long,ulong,float,double, ordecimal. - From
shorttoint,long,float,double, ordecimal. - From
ushorttoint,uint,long,ulong,float,double, ordecimal. - From
inttolong,float,double, ordecimal. - From
uinttolong,ulong,float,double, ordecimal. - From
longtofloat,double, ordecimal. - From
ulongtofloat,double, ordecimal. - From
chartoushort,int,uint,long,ulong,float,double, ordecimal. - From
floattodouble.
Conversions from int, uint, long, or ulong to float and from long or ulong to double may cause a loss of precision, but will never cause a loss of magnitude. The other implicit numeric conversions never lose any information.
There are no implicit conversions to the char type, so values of the other integral types do not automatically convert to the char type.