|
It seems that it can only be written like this. I looked at the integer table which has the following types:
sbyte byte char short ushort int uint long ulong
To know the zero value they correspond to, you can only write it in the following way:
if (object.Equals(obj, (sbyte)0) || object.Equals(obj, (byte)0) || object.Equals(obj, (char)0) || object.Equals(obj, (short) 0) || object.Equals(obj, (ushort)0) || object.Equals(obj, (int)0) || object.Equals(obj, (uint)0) || object.Equals(obj, ( long)0) || object.Equals(obj, (ulong)0))
{
System.Console.WriteLine("zero value");
}
else
{
System.Console.WriteLine("Non-zero value");
} |
|