private static object op_UnaryNegation(object operand, TypeCode operandTypeCode)
{
IConvertible operandConvertible = (IConvertible)operand;
switch (operandTypeCode)
{
case TypeCode.Decimal:
return -operandConvertible.ToDecimal(null);
case TypeCode.Double:
return -operandConvertible.ToDouble(null);
case TypeCode.Single:
return -operandConvertible.ToSingle(null);
case TypeCode.UInt64:
return -operandConvertible.ToInt64(null);
case TypeCode.Int64:
return -operandConvertible.ToInt64(null);
case TypeCode.UInt32:
return -operandConvertible.ToInt64(null);
default:
return -operandConvertible.ToInt32(null);
}
}