Implicit numeric conversions table (C# Reference)
The following table shows the predefined implicit conversions between .NET numeric types.
Precision but not magnitude might be lost in the conversions from
There are no implicit conversions to the
There are no implicit conversions from the
There are no implicit conversions between the
decimaltype and the
A value of a constant expression of type
int(for example, a value represented by an integral literal) can be converted to
ulong, provided it's within the range of the destination type:
byte a = 13; // Compiles byte b = 300; // CS0031: Constant value '300' cannot be converted to a 'byte'
We'd love to hear your thoughts. Choose the type you'd like to provide:
Our feedback system is built on GitHub Issues. Read more on our blog.